@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
@@ -3,12 +3,12 @@ import * as l from "react";
3
3
  import * as r from "@radix-ui/react-alert-dialog";
4
4
  import { cn as i } from "@brightlocal/ui-components/lib/utils";
5
5
  import { useOverlayPointerLock as m } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
6
- import { ButtonVariants as d } from "@brightlocal/ui-components/button";
6
+ import { ButtonVariants as s } from "@brightlocal/ui-components/button";
7
7
  function f({
8
8
  dataHook: a,
9
9
  trackingEl: t,
10
10
  trackingLabel: e,
11
- ...s
11
+ ...d
12
12
  }) {
13
13
  return /* @__PURE__ */ o(
14
14
  r.Root,
@@ -17,7 +17,7 @@ function f({
17
17
  "data-slot": "alert-dialog",
18
18
  "data-tracking-el": t,
19
19
  "data-tracking-label": e,
20
- ...s
20
+ ...d
21
21
  }
22
22
  );
23
23
  }
@@ -89,43 +89,43 @@ const u = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
89
89
  }
90
90
  ));
91
91
  u.displayName = "AlertDialogFooter";
92
- const N = l.forwardRef(({ className: a, dataHook: t, ...e }, s) => /* @__PURE__ */ o(
92
+ const y = l.forwardRef(({ className: a, dataHook: t, ...e }, d) => /* @__PURE__ */ o(
93
93
  r.Title,
94
94
  {
95
- ref: s,
96
- className: i("text-lg font-semibold", a),
95
+ ref: d,
96
+ className: i("text-heading-section", a),
97
97
  "data-hook": t,
98
98
  "data-slot": "alert-dialog-title",
99
99
  ...e
100
100
  }
101
101
  ));
102
- N.displayName = "AlertDialogTitle";
103
- const x = l.forwardRef(({ className: a, dataHook: t, ...e }, s) => /* @__PURE__ */ o(
102
+ y.displayName = "AlertDialogTitle";
103
+ const N = l.forwardRef(({ className: a, dataHook: t, ...e }, d) => /* @__PURE__ */ o(
104
104
  r.Description,
105
105
  {
106
- ref: s,
107
- className: i("text-muted-foreground text-sm", a),
106
+ ref: d,
107
+ className: i("text-body-sm text-muted-foreground", a),
108
108
  "data-hook": t,
109
109
  "data-slot": "alert-dialog-description",
110
110
  ...e
111
111
  }
112
112
  ));
113
- x.displayName = "AlertDialogDescription";
114
- const y = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
113
+ N.displayName = "AlertDialogDescription";
114
+ const x = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
115
115
  r.Action,
116
116
  {
117
117
  ref: e,
118
- className: i(d(), a),
118
+ className: i(s(), a),
119
119
  "data-slot": "alert-dialog-action",
120
120
  ...t
121
121
  }
122
122
  ));
123
- y.displayName = "AlertDialogAction";
123
+ x.displayName = "AlertDialogAction";
124
124
  const w = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
125
125
  r.Cancel,
126
126
  {
127
127
  ref: e,
128
- className: i(d({ variant: "outline" }), a),
128
+ className: i(s({ variant: "outline" }), a),
129
129
  "data-slot": "alert-dialog-cancel",
130
130
  ...t
131
131
  }
@@ -133,14 +133,14 @@ const w = l.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ o(
133
133
  w.displayName = "AlertDialogCancel";
134
134
  export {
135
135
  f as AlertDialog,
136
- y as AlertDialogAction,
136
+ x as AlertDialogAction,
137
137
  w as AlertDialogCancel,
138
138
  A as AlertDialogContent,
139
- x as AlertDialogDescription,
139
+ N as AlertDialogDescription,
140
140
  u as AlertDialogFooter,
141
141
  D as AlertDialogHeader,
142
142
  c as AlertDialogOverlay,
143
143
  n as AlertDialogPortal,
144
- N as AlertDialogTitle,
144
+ y as AlertDialogTitle,
145
145
  p as AlertDialogTrigger
146
146
  };
package/dist/alert.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),g=require("react"),h=require("class-variance-authority"),u=require("@brightlocal/icons"),c=require("@brightlocal/ui-components/lib/utils");function j(t){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const r in t)if(r!=="default"){const s=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(a,r,s.get?s:{enumerable:!0,get:()=>t[r]})}}return a.default=t,Object.freeze(a)}const x=j(g),m=h.cva("relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start",{variants:{variant:{default:"bg-muted text-foreground",success:"bg-success-background text-success-foreground",info:"bg-info-background text-info-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning-background text-warning-foreground"}},defaultVariants:{variant:"default"}}),d=x.forwardRef(({className:t,variant:a,...r},s)=>e.jsx("div",{ref:s,className:c.cn(m({variant:a}),t),"data-slot":"alert","data-tracking-el":`alert-${a}`,role:"alert",...r}));d.displayName="Alert";const o=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:c.cn("leading-5 font-medium break-words",t),"data-slot":"alert-title",...a}));o.displayName="AlertTitle";const f=x.forwardRef(({className:t,...a},r)=>e.jsx("div",{ref:r,className:c.cn("text-sm leading-5 font-normal [&_p]:leading-5",t),"data-slot":"alert-description",...a}));f.displayName="AlertDescription";function v({title:t,description:a,action:r,className:s,dataHook:l,trackingEl:n,trackingLabel:i}){return e.jsxs(d,{className:c.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":i,variant:"success",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleCheck,{className:"text-success-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(f,{children:a})]})]}),r&&e.jsx("div",{className:"shrink-0 self-center",children:r})]})}function k({title:t,description:a,action:r,className:s,dataHook:l,trackingEl:n,trackingLabel:i}){return e.jsxs(d,{className:c.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":i,variant:"info",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.Info,{className:"text-info-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(f,{children:a})]})]}),r&&e.jsx("div",{className:"shrink-0 self-center",children:r})]})}function N({title:t,description:a,action:r,className:s,dataHook:l,trackingEl:n,trackingLabel:i}){return e.jsxs(d,{className:c.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":i,variant:"destructive",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleX,{className:"text-destructive-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(f,{children:a})]})]}),r&&e.jsx("div",{className:"shrink-0 self-center",children:r})]})}function p({title:t,description:a,action:r,className:s,dataHook:l,trackingEl:n,trackingLabel:i}){return e.jsxs(d,{className:c.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":i,variant:"warning",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.TriangleAlert,{className:"text-warning-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),a!=null&&e.jsx(f,{children:a})]})]}),r&&e.jsx("div",{className:"shrink-0 self-center",children:r})]})}exports.Alert=d;exports.AlertDescription=f;exports.AlertDestructive=N;exports.AlertInfo=k;exports.AlertSuccess=v;exports.AlertTitle=o;exports.AlertWarning=p;exports.alertVariants=m;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),m=require("react"),h=require("@radix-ui/react-slot"),j=require("class-variance-authority"),u=require("@brightlocal/icons"),i=require("@brightlocal/ui-components/lib/utils");function v(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const s=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(r,a,s.get?s:{enumerable:!0,get:()=>t[a]})}}return r.default=t,Object.freeze(r)}const x=v(m),g=j.cva("relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",{variants:{variant:{default:"bg-muted text-foreground",success:"bg-success-background text-success-foreground",info:"bg-info-background text-info-foreground",destructive:"bg-destructive text-destructive-foreground",warning:"bg-warning-background text-warning-foreground"}},defaultVariants:{variant:"default"}}),d=x.forwardRef(({className:t,variant:r,...a},s)=>e.jsx("div",{ref:s,className:i.cn(g({variant:r}),t),"data-slot":"alert","data-tracking-el":`alert-${r}`,role:"alert",...a}));d.displayName="Alert";const o=x.forwardRef(({className:t,asChild:r=!1,...a},s)=>{const l=r?h.Slot:"div";return e.jsx(l,{ref:s,className:i.cn("text-heading-compact break-words",t),"data-slot":"alert-title",...a})});o.displayName="AlertTitle";const f=x.forwardRef(({className:t,...r},a)=>e.jsx("div",{ref:a,className:i.cn("text-body-sm [&_p]:leading-5",t),"data-slot":"alert-description",...r}));f.displayName="AlertDescription";function k({title:t,description:r,action:a,className:s,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"success",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleCheck,{className:"text-success-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),r!=null&&e.jsx(f,{children:r})]})]}),a&&e.jsx("div",{className:"shrink-0 self-center",children:a})]})}function N({title:t,description:r,action:a,className:s,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"info",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.Info,{className:"text-info-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),r!=null&&e.jsx(f,{children:r})]})]}),a&&e.jsx("div",{className:"shrink-0 self-center",children:a})]})}function p({title:t,description:r,action:a,className:s,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"destructive",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.CircleX,{className:"text-destructive-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),r!=null&&e.jsx(f,{children:r})]})]}),a&&e.jsx("div",{className:"shrink-0 self-center",children:a})]})}function b({title:t,description:r,action:a,className:s,dataHook:l,trackingEl:n,trackingLabel:c}){return e.jsxs(d,{className:i.cn("items-center",s),"data-hook":l,"data-tracking-el":n,"data-tracking-label":c,variant:"warning",children:[e.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[e.jsx(u.TriangleAlert,{className:"text-warning-foreground shrink-0 translate-y-0.5"}),e.jsxs("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[t&&e.jsx(o,{children:t}),r!=null&&e.jsx(f,{children:r})]})]}),a&&e.jsx("div",{className:"shrink-0 self-center",children:a})]})}exports.Alert=d;exports.AlertDescription=f;exports.AlertDestructive=p;exports.AlertInfo=N;exports.AlertSuccess=k;exports.AlertTitle=o;exports.AlertWarning=b;exports.alertVariants=g;
package/dist/alert.d.ts CHANGED
@@ -6,7 +6,16 @@ declare const alertVariants: (props?: ({
6
6
  declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
7
7
  variant?: "default" | "info" | "success" | "destructive" | "warning" | null | undefined;
8
8
  } & import('class-variance-authority/types').ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
9
- declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
9
+ interface AlertTitleProps extends React.HTMLAttributes<HTMLDivElement> {
10
+ /**
11
+ * Render the title as its child element (e.g. an `h2`–`h6`) so consumers
12
+ * can opt the alert title into the document outline at the level their
13
+ * page calls for.
14
+ * @default false
15
+ */
16
+ asChild?: boolean;
17
+ }
18
+ declare const AlertTitle: React.ForwardRefExoticComponent<AlertTitleProps & React.RefAttributes<HTMLDivElement>>;
10
19
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
11
20
  interface AlertContentBaseProps {
12
21
  /**
@@ -57,4 +66,5 @@ declare function AlertInfo({ title, description, action, className, dataHook, tr
57
66
  declare function AlertDestructive({ title, description, action, className, dataHook, trackingEl, trackingLabel, }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
58
67
  declare function AlertWarning({ title, description, action, className, dataHook, trackingEl, trackingLabel, }: AlertContentProps): import("react/jsx-runtime").JSX.Element;
59
68
  export { Alert, AlertTitle, AlertDescription, alertVariants, AlertSuccess, AlertInfo, AlertDestructive, AlertWarning, };
69
+ export type { AlertTitleProps };
60
70
  //# sourceMappingURL=alert.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,QAAA,MAAM,UAAU,6GAUd,CAAC;AAGH,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;AAEJ,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,GACb,CAAC"}
1
+ {"version":3,"file":"alert.d.ts","sourceRoot":"","sources":["../../src/components/alert.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAKlE,QAAA,MAAM,aAAa;;8EAgBlB,CAAC;AAEF,QAAA,MAAM,KAAK;;sHAYT,CAAC;AAGH,UAAU,eAAgB,SAAQ,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC;IACpE;;;;;OAKG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,QAAA,MAAM,UAAU,wFAYf,CAAC;AAGF,QAAA,MAAM,gBAAgB,6GAUpB,CAAC;AAGH,UAAU,qBAAqB;IAC7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,KAAK,iBAAiB,GAAG,qBAAqB,GAC5C,CACI;IACE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC/B,GACD;IACE;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,WAAW,EAAE,KAAK,CAAC,SAAS,CAAC;CAC9B,CACJ,CAAC;AAEJ,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,SAAS,CAAC,EACjB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,gBAAgB,CAAC,EACxB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,iBAAS,YAAY,CAAC,EACpB,KAAK,EACL,WAAW,EACX,MAAM,EACN,SAAS,EACT,QAAQ,EACR,UAAU,EACV,aAAa,GACd,EAAE,iBAAiB,2CAqBnB;AAED,OAAO,EACL,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,gBAAgB,EAChB,YAAY,GACb,CAAC;AACF,YAAY,EAAE,eAAe,EAAE,CAAC"}
package/dist/alert.js CHANGED
@@ -1,10 +1,11 @@
1
1
  import { jsx as e, jsxs as l } from "react/jsx-runtime";
2
2
  import * as g from "react";
3
- import { cva as u } from "class-variance-authority";
4
- import { CircleX as h, Info as x, CircleCheck as v, TriangleAlert as k } from "@brightlocal/icons";
3
+ import { Slot as u } from "@radix-ui/react-slot";
4
+ import { cva as h } from "class-variance-authority";
5
+ import { CircleX as x, Info as v, CircleCheck as k, TriangleAlert as N } from "@brightlocal/icons";
5
6
  import { cn as d } from "@brightlocal/ui-components/lib/utils";
6
- const N = u(
7
- "relative w-full rounded-lg px-4 py-3 text-sm flex gap-3 items-start",
7
+ const p = h(
8
+ "relative w-full rounded-lg px-4 py-3 flex gap-3 items-start",
8
9
  {
9
10
  variants: {
10
11
  variant: {
@@ -23,7 +24,7 @@ const N = u(
23
24
  "div",
24
25
  {
25
26
  ref: n,
26
- className: d(N({ variant: a }), r),
27
+ className: d(p({ variant: a }), r),
27
28
  "data-slot": "alert",
28
29
  "data-tracking-el": `alert-${a}`,
29
30
  role: "alert",
@@ -31,27 +32,29 @@ const N = u(
31
32
  }
32
33
  ));
33
34
  o.displayName = "Alert";
34
- const f = g.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
35
- "div",
36
- {
37
- ref: t,
38
- className: d("leading-5 font-medium break-words", r),
39
- "data-slot": "alert-title",
40
- ...a
41
- }
42
- ));
35
+ const f = g.forwardRef(
36
+ ({ className: r, asChild: a = !1, ...t }, n) => /* @__PURE__ */ e(
37
+ a ? u : "div",
38
+ {
39
+ ref: n,
40
+ className: d("text-heading-compact break-words", r),
41
+ "data-slot": "alert-title",
42
+ ...t
43
+ }
44
+ )
45
+ );
43
46
  f.displayName = "AlertTitle";
44
47
  const m = g.forwardRef(({ className: r, ...a }, t) => /* @__PURE__ */ e(
45
48
  "div",
46
49
  {
47
50
  ref: t,
48
- className: d("text-sm leading-5 font-normal [&_p]:leading-5", r),
51
+ className: d("text-body-sm [&_p]:leading-5", r),
49
52
  "data-slot": "alert-description",
50
53
  ...a
51
54
  }
52
55
  ));
53
56
  m.displayName = "AlertDescription";
54
- function y({
57
+ function R({
55
58
  title: r,
56
59
  description: a,
57
60
  action: t,
@@ -70,7 +73,7 @@ function y({
70
73
  variant: "success",
71
74
  children: [
72
75
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
73
- /* @__PURE__ */ e(v, { className: "text-success-foreground shrink-0 translate-y-0.5" }),
76
+ /* @__PURE__ */ e(k, { className: "text-success-foreground shrink-0 translate-y-0.5" }),
74
77
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
75
78
  r && /* @__PURE__ */ e(f, { children: r }),
76
79
  a != null && /* @__PURE__ */ e(m, { children: a })
@@ -81,7 +84,7 @@ function y({
81
84
  }
82
85
  );
83
86
  }
84
- function R({
87
+ function D({
85
88
  title: r,
86
89
  description: a,
87
90
  action: t,
@@ -100,7 +103,7 @@ function R({
100
103
  variant: "info",
101
104
  children: [
102
105
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
103
- /* @__PURE__ */ e(x, { className: "text-info-foreground shrink-0 translate-y-0.5" }),
106
+ /* @__PURE__ */ e(v, { className: "text-info-foreground shrink-0 translate-y-0.5" }),
104
107
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
105
108
  r && /* @__PURE__ */ e(f, { children: r }),
106
109
  a != null && /* @__PURE__ */ e(m, { children: a })
@@ -111,7 +114,7 @@ function R({
111
114
  }
112
115
  );
113
116
  }
114
- function C({
117
+ function T({
115
118
  title: r,
116
119
  description: a,
117
120
  action: t,
@@ -130,7 +133,7 @@ function C({
130
133
  variant: "destructive",
131
134
  children: [
132
135
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
133
- /* @__PURE__ */ e(h, { className: "text-destructive-foreground shrink-0 translate-y-0.5" }),
136
+ /* @__PURE__ */ e(x, { className: "text-destructive-foreground shrink-0 translate-y-0.5" }),
134
137
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
135
138
  r && /* @__PURE__ */ e(f, { children: r }),
136
139
  a != null && /* @__PURE__ */ e(m, { children: a })
@@ -141,7 +144,7 @@ function C({
141
144
  }
142
145
  );
143
146
  }
144
- function D({
147
+ function j({
145
148
  title: r,
146
149
  description: a,
147
150
  action: t,
@@ -160,7 +163,7 @@ function D({
160
163
  variant: "warning",
161
164
  children: [
162
165
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 items-start gap-3", children: [
163
- /* @__PURE__ */ e(k, { className: "text-warning-foreground shrink-0 translate-y-0.5" }),
166
+ /* @__PURE__ */ e(N, { className: "text-warning-foreground shrink-0 translate-y-0.5" }),
164
167
  /* @__PURE__ */ l("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [
165
168
  r && /* @__PURE__ */ e(f, { children: r }),
166
169
  a != null && /* @__PURE__ */ e(m, { children: a })
@@ -174,10 +177,10 @@ function D({
174
177
  export {
175
178
  o as Alert,
176
179
  m as AlertDescription,
177
- C as AlertDestructive,
178
- R as AlertInfo,
179
- y as AlertSuccess,
180
+ T as AlertDestructive,
181
+ D as AlertInfo,
182
+ R as AlertSuccess,
180
183
  f as AlertTitle,
181
- D as AlertWarning,
182
- N as alertVariants
184
+ j as AlertWarning,
185
+ p as alertVariants
183
186
  };
package/dist/avatar.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),g=require("@radix-ui/react-avatar"),o=require("@brightlocal/ui-components/lib/utils");function n(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const c=n(v),l=n(g),i=c.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:r,...f},m)=>s.jsx(l.Root,{ref:m,className:o.cn("relative flex size-10 shrink-0 overflow-hidden rounded-full",a),"data-hook":t,"data-slot":"avatar","data-tracking-el":e,"data-tracking-label":r,...f}));i.displayName=l.Root.displayName;const u=c.forwardRef(({className:a,...t},e)=>s.jsx(l.Image,{ref:e,className:o.cn("aspect-square size-full",a),"data-slot":"avatar-image",...t}));u.displayName="AvatarImage";const d=c.forwardRef(({className:a,...t},e)=>s.jsx(l.Fallback,{ref:e,className:o.cn("bg-muted text-foreground flex size-full items-center justify-center rounded-full text-sm",a),"data-slot":"avatar-fallback",...t}));d.displayName="AvatarFallback";exports.Avatar=i;exports.AvatarFallback=d;exports.AvatarImage=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react"),b=require("@radix-ui/react-avatar"),o=require("@brightlocal/ui-components/lib/utils");function n(a){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const e in a)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(a,e);Object.defineProperty(t,e,r.get?r:{enumerable:!0,get:()=>a[e]})}}return t.default=a,Object.freeze(t)}const c=n(v),l=n(b),i=c.forwardRef(({className:a,dataHook:t,trackingEl:e,trackingLabel:r,...f},m)=>s.jsx(l.Root,{ref:m,className:o.cn("relative flex size-10 shrink-0 overflow-hidden rounded-full",a),"data-hook":t,"data-slot":"avatar","data-tracking-el":e,"data-tracking-label":r,...f}));i.displayName=l.Root.displayName;const d=c.forwardRef(({className:a,...t},e)=>s.jsx(l.Image,{ref:e,className:o.cn("aspect-square size-full",a),"data-slot":"avatar-image",...t}));d.displayName="AvatarImage";const u=c.forwardRef(({className:a,...t},e)=>s.jsx(l.Fallback,{ref:e,className:o.cn("text-body-sm bg-muted text-foreground flex size-full items-center justify-center rounded-full",a),"data-slot":"avatar-fallback",...t}));u.displayName="AvatarFallback";exports.Avatar=i;exports.AvatarFallback=u;exports.AvatarImage=d;
package/dist/avatar.js CHANGED
@@ -2,10 +2,10 @@ import { jsx as l } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
3
  import * as r from "@radix-ui/react-avatar";
4
4
  import { cn as s } from "@brightlocal/ui-components/lib/utils";
5
- const f = o.forwardRef(({ className: a, dataHook: t, trackingEl: e, trackingLabel: m, ...i }, d) => /* @__PURE__ */ l(
5
+ const f = o.forwardRef(({ className: a, dataHook: t, trackingEl: e, trackingLabel: m, ...d }, i) => /* @__PURE__ */ l(
6
6
  r.Root,
7
7
  {
8
- ref: d,
8
+ ref: i,
9
9
  className: s(
10
10
  "relative flex size-10 shrink-0 overflow-hidden rounded-full",
11
11
  a
@@ -14,7 +14,7 @@ const f = o.forwardRef(({ className: a, dataHook: t, trackingEl: e, trackingLabe
14
14
  "data-slot": "avatar",
15
15
  "data-tracking-el": e,
16
16
  "data-tracking-label": m,
17
- ...i
17
+ ...d
18
18
  }
19
19
  ));
20
20
  f.displayName = r.Root.displayName;
@@ -33,7 +33,7 @@ const n = o.forwardRef(({ className: a, ...t }, e) => /* @__PURE__ */ l(
33
33
  {
34
34
  ref: e,
35
35
  className: s(
36
- "bg-muted text-foreground flex size-full items-center justify-center rounded-full text-sm",
36
+ "text-body-sm bg-muted text-foreground flex size-full items-center justify-center rounded-full",
37
37
  a
38
38
  ),
39
39
  "data-slot": "avatar-fallback",
package/dist/badge.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("react"),f=require("@radix-ui/react-slot"),p=require("class-variance-authority"),_=require("@brightlocal/ui-components/lib/utils");function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=v(g),x=p.cva(["inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden","rounded-full border px-2 py-1","text-xs font-semibold whitespace-nowrap leading-none","[&>svg]:size-3 [&>svg]:pointer-events-none","transition-[color,background-color,border-color,box-shadow] duration-fast ease-out","focus-visible:outline-none","focus-visible:shadow-[0_0_0_1px_white,0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(0,0,0,0.1)]","dark:focus-visible:shadow-[0_0_0_1px_var(--background),0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(255,255,255,0.1)]","data-[number=true]:size-5 data-[number=true]:p-0 data-[number=true]:aspect-square"],{variants:{variant:{primary:"border-transparent bg-success-background text-success-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground focus-visible:border-ring",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"bg-background border-border text-foreground focus-visible:border-ring"}},defaultVariants:{variant:"primary"}}),n=m.forwardRef(({className:e,variant:t,asChild:r=!1,dataHook:a,trackingEl:s,trackingLabel:i,children:o,...c},u)=>{const d=r?f.Slot:"span",b=typeof o=="string"&&/^[0-9]$/.test(o);return l.jsx(d,{ref:u,className:_.cn(x({variant:t}),e),"data-hook":a,"data-number":b,"data-slot":"badge","data-tracking-el":s,"data-tracking-label":i,...c,children:o})});n.displayName="Badge";exports.Badge=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),g=require("react"),f=require("@radix-ui/react-slot"),p=require("class-variance-authority"),_=require("@brightlocal/ui-components/lib/utils");function v(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const a=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,a.get?a:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const m=v(g),x=p.cva(["inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden","rounded-full border px-2 py-0.5","text-label-sm whitespace-nowrap","[&>svg]:size-3 [&>svg]:pointer-events-none","transition-[color,background-color,border-color,box-shadow] duration-fast ease-out","focus-visible:outline-none","focus-visible:shadow-[0_0_0_1px_white,0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(0,0,0,0.1)]","dark:focus-visible:shadow-[0_0_0_1px_var(--background),0_0_0_2px_var(--color-ring),0_0_0_4px_rgba(255,255,255,0.1)]","data-[number=true]:size-5 data-[number=true]:p-0 data-[number=true]:aspect-square"],{variants:{variant:{primary:"border-transparent bg-success-background text-success-foreground",secondary:"border-transparent bg-secondary text-secondary-foreground focus-visible:border-ring",destructive:"border-transparent bg-destructive text-destructive-foreground",outline:"bg-background border-border text-foreground focus-visible:border-ring"}},defaultVariants:{variant:"primary"}}),n=m.forwardRef(({className:e,variant:t,asChild:r=!1,dataHook:a,trackingEl:s,trackingLabel:i,children:o,...c},u)=>{const d=r?f.Slot:"span",b=typeof o=="string"&&/^[0-9]$/.test(o);return l.jsx(d,{ref:u,className:_.cn(x({variant:t}),e),"data-hook":a,"data-number":b,"data-slot":"badge","data-tracking-el":s,"data-tracking-label":i,...c,children:o})});n.displayName="Badge";exports.Badge=n;
@@ -1 +1 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;8EAoClB,CAAC;AAEF;;GAEG;AACH,UAAU,UACR,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;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,QAAA,MAAM,KAAK,iGAmCV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/components/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAIlE,QAAA,MAAM,aAAa;;8EAwClB,CAAC;AAEF;;GAEG;AACH,UAAU,UACR,SAAQ,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC,OAAO,aAAa,CAAC;IACxE;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;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,QAAA,MAAM,KAAK,iGAmCV,CAAC;AAIF,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
package/dist/badge.js CHANGED
@@ -1,16 +1,20 @@
1
1
  import { jsx as b } from "react/jsx-runtime";
2
2
  import * as g from "react";
3
3
  import { Slot as p } from "@radix-ui/react-slot";
4
- import { cva as f } from "class-variance-authority";
5
- import { cn as l } from "@brightlocal/ui-components/lib/utils";
6
- const _ = f(
4
+ import { cva as l } from "class-variance-authority";
5
+ import { cn as f } from "@brightlocal/ui-components/lib/utils";
6
+ const _ = l(
7
7
  [
8
8
  // Layout
9
9
  "inline-flex items-center justify-center gap-1 w-fit shrink-0 overflow-hidden",
10
- // Spacing & shape
11
- "rounded-full border px-2 py-1",
12
- // Typography
13
- "text-xs font-semibold whitespace-nowrap leading-none",
10
+ // Spacing & shape — 2px vertical padding around the 16px line box keeps the
11
+ // content box 20px, matching the Figma frame (its stroke sits inside); the
12
+ // 1px border makes the rendered box 22px, unchanged from the pre-scale
13
+ // `leading-none` + py-1 stack (DS-925)
14
+ "rounded-full border px-2 py-0.5",
15
+ // Typography — type-scale role for badges (12/16 Figma 500; the weight
16
+ // drop from the old semibold is intentional, DS-925)
17
+ "text-label-sm whitespace-nowrap",
14
18
  // Icons
15
19
  "[&>svg]:size-3 [&>svg]:pointer-events-none",
16
20
  // Transition
@@ -38,20 +42,20 @@ const _ = f(
38
42
  ), m = g.forwardRef(
39
43
  ({
40
44
  className: e,
41
- variant: o,
42
- asChild: a = !1,
45
+ variant: a,
46
+ asChild: o = !1,
43
47
  dataHook: t,
44
48
  trackingEl: s,
45
49
  trackingLabel: n,
46
50
  children: r,
47
51
  ...i
48
52
  }, d) => {
49
- const c = a ? p : "span", u = typeof r == "string" && /^[0-9]$/.test(r);
53
+ const c = o ? p : "span", u = typeof r == "string" && /^[0-9]$/.test(r);
50
54
  return /* @__PURE__ */ b(
51
55
  c,
52
56
  {
53
57
  ref: d,
54
- className: l(_({ variant: o }), e),
58
+ className: f(_({ variant: a }), e),
55
59
  "data-hook": t,
56
60
  "data-number": u,
57
61
  "data-slot": "badge",
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),v=require("react"),r=require("@brightlocal/ui-components/lib/utils"),T=require("../typography-heading.cjs"),I=require("../typography-text.cjs"),b=require("../lib/block-illustration.cjs"),_=require("../lib/empty-chip.cjs");function L(t){const s=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const e=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(s,n,e.get?e:{enumerable:!0,get:()=>t[n]})}}return s.default=t,Object.freeze(s)}const o=L(v),O={md:"subsection",lg:"section"},q={lg:2,md:3},j=o.forwardRef((t,s)=>{const{className:n,dataHook:e,title:k,description:m,children:p,titleLevel:E,trackingEl:u,trackingLabel:g,size:c="md",...N}=t,y=t.icon,f=t.illustration,l=c==="lg"?"center":t.align??"center",i=N;delete i.icon,delete i.illustration,delete i.align;const S=o.Children.toArray(p).flatMap(d=>o.isValidElement(d)&&d.type===o.Fragment?o.Children.toArray(d.props.children):[d]).length>0,x=c==="lg"&&f?a.jsx(b.BlockIllustration,{size:b.BLOCK_ILLUSTRATION_SIZE,slot:"empty-state-illustration",children:f}):y?a.jsx("span",{"aria-hidden":"true",className:r.cn(_.emptyChipStyles({align:l}),c==="md"&&l==="center"&&"mb-1"),"data-hook":`${e}-icon`,"data-slot":"empty-state-icon",children:y}):null,h=a.jsxs("div",{className:r.cn("flex flex-col gap-2",l==="center"&&"w-full items-center"),"data-slot":"empty-state-content",children:[a.jsx(T.TypographyHeading,{align:l==="center"?"center":"left","data-slot":"empty-state-title",dataHook:`${e}-title`,level:E??q[c],variant:O[c],children:k}),m?a.jsx(I.TypographyText,{align:l==="center"?"center":"left",className:"max-w-md",color:"muted","data-slot":"empty-state-description",dataHook:`${e}-message`,variant:"body-sm",children:m}):null,S?a.jsx("div",{className:r.cn("mt-2 flex items-center gap-4",l==="center"&&"justify-center"),"data-slot":"empty-state-actions",children:p}):null]});return c==="lg"?a.jsxs("div",{ref:s,className:r.cn("flex w-full flex-col items-center gap-6",n),"data-hook":e,"data-size":"lg","data-slot":"empty-state","data-tracking-el":u??"empty-state","data-tracking-label":g,...i,children:[x,h]}):a.jsxs("div",{ref:s,className:r.cn(l==="left"?"flex items-start gap-4 text-left":"flex flex-col items-center gap-2 text-center",n),"data-hook":e,"data-size":"md","data-slot":"empty-state","data-tracking-el":u??"empty-state","data-tracking-label":g,...i,children:[x,h]})});j.displayName="EmptyState";exports.EmptyState=j;
@@ -0,0 +1,172 @@
1
+ import { TypographyHeadingLevel } from '../typography-heading';
2
+ import * as React from "react";
3
+ /**
4
+ * Visual prominence of the block. It sets the title's role, the kind of
5
+ * visual, and the rhythm — never the layout, which stays the consumer's.
6
+ */
7
+ type EmptyStateSize = "md" | "lg";
8
+ /**
9
+ * Where an md block's content sits relative to its visual.
10
+ * - `center` — the column centres under the chip. For a standalone area the
11
+ * block fills: a zero-row table, a chart well, a panel.
12
+ * - `left` — the chip sits beside a left-aligned column, so the text joins the
13
+ * reading flow of the card it lives in rather than interrupting it.
14
+ *
15
+ * lg has no alignment: a page message is centred, full stop.
16
+ */
17
+ type EmptyStateAlign = "center" | "left";
18
+ /**
19
+ * The parts every empty state has, at either size.
20
+ */
21
+ interface EmptyStateBaseProps extends Omit<React.ComponentPropsWithoutRef<"div">, "title"> {
22
+ /**
23
+ * Required data-hook attribute for automated testing. The parts derive
24
+ * theirs from it: `-icon`, `-title`, `-message`.
25
+ * @example "locations-empty"
26
+ */
27
+ dataHook: string;
28
+ /**
29
+ * What is missing, as a real heading. Name the thing, not the condition:
30
+ * "No locations yet", never "Empty".
31
+ */
32
+ title: React.ReactNode;
33
+ /**
34
+ * One line under the title: what would put something here, or why there is
35
+ * nothing. May carry an inline link that reads as part of the sentence.
36
+ */
37
+ description?: React.ReactNode;
38
+ /**
39
+ * The actions row. Source order is the rendered order and the primary action
40
+ * goes last, so the CTA lands rightmost; a quiet
41
+ * `<Link variant="ghost" external>` comes before it. Never a second bordered
42
+ * button — two buttons of equal weight ask the reader to choose twice.
43
+ *
44
+ * Omit it entirely on a gated screen: the reader cannot act, and a button
45
+ * they are not allowed to press is worse than no button.
46
+ */
47
+ children?: React.ReactNode;
48
+ /**
49
+ * Document outline level for the title. Pick it as if CSS did not exist —
50
+ * the text's size comes from `size`, never from this.
51
+ * @default 3 at size md, 2 at size lg
52
+ */
53
+ titleLevel?: TypographyHeadingLevel;
54
+ /**
55
+ * Tracking element identifier for analytics.
56
+ */
57
+ trackingEl?: string;
58
+ /**
59
+ * Tracking label for analytics context.
60
+ */
61
+ trackingLabel?: string;
62
+ }
63
+ /**
64
+ * The block at md: filling one region of a working page.
65
+ */
66
+ interface EmptyStateMdProps extends EmptyStateBaseProps {
67
+ /**
68
+ * @default "md"
69
+ */
70
+ size?: "md";
71
+ /**
72
+ * Content alignment relative to the chip.
73
+ * @default "center"
74
+ */
75
+ align?: EmptyStateAlign;
76
+ /**
77
+ * The glyph in the muted chip, at its default 16px. Decorative: the wrapper
78
+ * is `aria-hidden`, so pass the glyph and nothing else.
79
+ * @example <MapPin />
80
+ */
81
+ icon?: React.ReactNode;
82
+ /**
83
+ * Not available at md — a 130px drawing inside a card outweighs the page
84
+ * around it. Use `size="lg"`, or pass an `icon`.
85
+ */
86
+ illustration?: never;
87
+ }
88
+ /**
89
+ * The block at lg: the whole page has nothing to show.
90
+ */
91
+ interface EmptyStateLgProps extends EmptyStateBaseProps {
92
+ size: "lg";
93
+ /**
94
+ * The screen's illustration. Decorative — mark it `aria-hidden`; the title
95
+ * and description carry the state on their own.
96
+ *
97
+ * Pass the illustration itself and do NOT set a size: the block renders it at
98
+ * the size the design specifies, whatever the element carries, so there is no
99
+ * number to get wrong per call site.
100
+ * @example <BusinessLocation aria-hidden />
101
+ */
102
+ illustration?: React.ReactNode;
103
+ /**
104
+ * A glyph in the muted chip, for a page with no illustration of its own.
105
+ * Ignored when `illustration` is set — a screen gets one visual, not two.
106
+ */
107
+ icon?: React.ReactNode;
108
+ /**
109
+ * Not available at lg: a page message is centred, full stop.
110
+ */
111
+ align?: never;
112
+ }
113
+ /**
114
+ * Props for the EmptyState block. `size` discriminates the two shapes.
115
+ */
116
+ export type EmptyStateProps = EmptyStateMdProps | EmptyStateLgProps;
117
+ /**
118
+ * The empty block: a visual, a title, one supporting line, and up to two
119
+ * actions. Pure content — compose the position around it: `size="lg"` inside
120
+ * `<Grid variant="centered">` for an empty page, `size="md"` inside the card, panel or
121
+ * table frame it speaks for.
122
+ *
123
+ * @example
124
+ * ```tsx
125
+ * // A zero-row collection, inside the table's own frame.
126
+ * <EmptyState
127
+ * dataHook="locations-empty"
128
+ * description="Add a location to start tracking visibility."
129
+ * icon={<MapPin />}
130
+ * title={t("locations.empty.title")}
131
+ * >
132
+ * <Button dataHook="locations-add" variant="secondary">
133
+ * <Plus aria-hidden="true" />
134
+ * Add location
135
+ * </Button>
136
+ * </EmptyState>
137
+ *
138
+ * // In a card's reading flow, with a quiet secondary action before the CTA.
139
+ * <EmptyState
140
+ * align="left"
141
+ * dataHook="reviews-empty"
142
+ * description={t("reviews.empty.description")}
143
+ * icon={<MessageSquareText />}
144
+ * title="No reviews yet"
145
+ * >
146
+ * <Link dataHook="reviews-docs" external href="/help/reviews" variant="ghost">
147
+ * How review sync works
148
+ * </Link>
149
+ * <Button dataHook="reviews-connect" variant="secondary">Connect profile</Button>
150
+ * </EmptyState>
151
+ *
152
+ * // The whole page is empty: lg, held at the page body's optical centre.
153
+ * <Grid dataHook="locations-empty-center" variant="centered">
154
+ * <EmptyState
155
+ * dataHook="locations-empty-page"
156
+ * description={t("locations.empty.description")}
157
+ * illustration={<BusinessLocation aria-hidden />}
158
+ * size="lg"
159
+ * title={t("locations.empty.title")}
160
+ * >
161
+ * <Button dataHook="locations-add">
162
+ * <Plus aria-hidden="true" />
163
+ * Add location
164
+ * </Button>
165
+ * </EmptyState>
166
+ * </Grid>
167
+ * ```
168
+ */
169
+ declare const EmptyState: React.ForwardRefExoticComponent<EmptyStateProps & React.RefAttributes<HTMLDivElement>>;
170
+ export { EmptyState };
171
+ export type { EmptyStateAlign, EmptyStateSize };
172
+ //# sourceMappingURL=empty-state.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"empty-state.d.ts","sourceRoot":"","sources":["../../src/blocks/empty-state.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,kCAAkC,CAAC;AA+C1C;;;GAGG;AACH,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,CAAC;AAElC;;;;;;;;GAQG;AACH,KAAK,eAAe,GAAG,QAAQ,GAAG,MAAM,CAAC;AAkBzC;;GAEG;AACH,UAAU,mBAAoB,SAAQ,IAAI,CACxC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EACrC,OAAO,CACR;IACC;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B;;;;OAIG;IACH,UAAU,CAAC,EAAE,sBAAsB,CAAC;IACpC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,UAAU,iBAAkB,SAAQ,mBAAmB;IACrD;;OAEG;IACH,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ;;;OAGG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB;;;;OAIG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;;OAGG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC;CACtB;AAED;;GAEG;AACH,UAAU,iBAAkB,SAAQ,mBAAmB;IACrD,IAAI,EAAE,IAAI,CAAC;IACX;;;;;;;;OAQG;IACH,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC;CACf;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,iBAAiB,CAAC;AAEpE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,QAAA,MAAM,UAAU,wFAiKf,CAAC;AAIF,OAAO,EAAE,UAAU,EAAE,CAAC;AAEtB,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,CAAC"}