@brightlocal/ui-components 2.21.0 → 2.23.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 (70) hide show
  1. package/README.md +2 -1
  2. package/component-meta.json +40 -5
  3. package/dist/alert.cjs +1 -1
  4. package/dist/alert.d.ts.map +1 -1
  5. package/dist/alert.js +31 -31
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.d.ts +35 -3
  8. package/dist/blocks/data-table.d.ts.map +1 -1
  9. package/dist/blocks/data-table.js +178 -152
  10. package/dist/context-menu.cjs +1 -1
  11. package/dist/context-menu.d.ts.map +1 -1
  12. package/dist/context-menu.js +111 -109
  13. package/dist/dropdown-menu.cjs +1 -1
  14. package/dist/dropdown-menu.d.ts.map +1 -1
  15. package/dist/dropdown-menu.js +109 -121
  16. package/dist/hover-card.cjs +1 -1
  17. package/dist/hover-card.d.ts.map +1 -1
  18. package/dist/hover-card.js +45 -45
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.ts +1 -0
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +311 -308
  23. package/dist/lib/utils.cjs +1 -1
  24. package/dist/lib/utils.d.ts +1 -0
  25. package/dist/lib/utils.d.ts.map +1 -1
  26. package/dist/lib/utils.js +7 -5
  27. package/dist/loading.cjs +1 -0
  28. package/dist/loading.d.ts +46 -0
  29. package/dist/loading.d.ts.map +1 -0
  30. package/dist/loading.js +142 -0
  31. package/dist/map.cjs +1 -1
  32. package/dist/map.d.ts.map +1 -1
  33. package/dist/map.js +1 -1
  34. package/dist/menubar.cjs +1 -1
  35. package/dist/menubar.d.ts.map +1 -1
  36. package/dist/menubar.js +97 -99
  37. package/dist/navigation-menu.cjs +1 -1
  38. package/dist/navigation-menu.d.ts +5 -7
  39. package/dist/navigation-menu.d.ts.map +1 -1
  40. package/dist/navigation-menu.js +82 -90
  41. package/dist/popover.cjs +1 -1
  42. package/dist/popover.d.ts.map +1 -1
  43. package/dist/popover.js +27 -26
  44. package/dist/select.cjs +2 -2
  45. package/dist/select.d.ts.map +1 -1
  46. package/dist/select.js +29 -35
  47. package/dist/table.cjs +1 -1
  48. package/dist/table.d.ts +22 -2
  49. package/dist/table.d.ts.map +1 -1
  50. package/dist/table.js +57 -43
  51. package/dist/tooltip.cjs +1 -1
  52. package/dist/tooltip.d.ts +21 -2
  53. package/dist/tooltip.d.ts.map +1 -1
  54. package/dist/tooltip.js +37 -34
  55. package/package.json +1 -1
  56. package/src/blocks/data-table.tsx +58 -4
  57. package/src/components/alert.tsx +9 -13
  58. package/src/components/context-menu.tsx +8 -3
  59. package/src/components/dropdown-menu.tsx +6 -15
  60. package/src/components/hover-card.tsx +6 -3
  61. package/src/components/loading.tsx +322 -0
  62. package/src/components/map.tsx +3 -1
  63. package/src/components/menubar.tsx +6 -5
  64. package/src/components/navigation-menu.tsx +80 -101
  65. package/src/components/popover.tsx +6 -2
  66. package/src/components/select.tsx +5 -8
  67. package/src/components/table.tsx +44 -7
  68. package/src/components/tooltip.tsx +36 -8
  69. package/src/index.ts +1 -0
  70. package/src/lib/utils.ts +3 -0
@@ -1 +1 @@
1
- {"version":3,"file":"table.d.ts","sourceRoot":"","sources":["../../src/components/table.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAQlE,QAAA,MAAM,iBAAiB;;;8EAoBtB,CAAC;AAEF,QAAA,MAAM,iBAAiB;;8EActB,CAAC;AAMF,UAAU,UAAW,SAAQ,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC;IACxD;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;I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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/B;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACrC;AAED,QAAA,MAAM,SAAS,0GAcd,CAAC;AAQF,UAAU,iBAAkB,SAAQ,KAAK,CAAC,cAAc,CAAC,SAAS,CAAC;IACjE;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,QAAA,MAAM,YAAY,gHAWhB,CAAC;AAQH,OAAO,EACL,KAAK,EACL,WAAW,EACX,SAAS,EACT,WAAW,EACX,SAAS,EACT,QAAQ,EACR,SAAS,EACT,YAAY,GACb,CAAC;AAEF,YAAY,EACV,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,aAAa,EACb,cAAc,EACd,cAAc,EACd,iBAAiB,GAClB,CAAC"}
package/dist/table.js CHANGED
@@ -2,7 +2,7 @@ import { jsx as l } from "react/jsx-runtime";
2
2
  import * as r from "react";
3
3
  import { cva as c } from "class-variance-authority";
4
4
  import { cn as d } from "@brightlocal/ui-components/lib/utils";
5
- const m = c(
5
+ const u = c(
6
6
  "align-middle bg-transparent text-foreground text-sm font-normal leading-normal break-words",
7
7
  {
8
8
  variants: {
@@ -22,7 +22,7 @@ const m = c(
22
22
  align: "left"
23
23
  }
24
24
  }
25
- ), u = c(
25
+ ), p = c(
26
26
  "h-10 p-2 align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words outline-none focus-visible:shadow-default transition-[background-color,box-shadow] duration-150 ease-in-out",
27
27
  {
28
28
  variants: {
@@ -36,17 +36,18 @@ const m = c(
36
36
  align: "left"
37
37
  }
38
38
  }
39
- ), p = r.forwardRef(
39
+ ), g = r.forwardRef(
40
40
  ({
41
41
  className: a,
42
42
  dataHook: t,
43
43
  trackingEl: e,
44
44
  trackingLabel: o,
45
+ layout: n = "auto",
45
46
  minWidth: s,
46
- scrollRegionLabel: n,
47
- style: i,
48
- ...b
49
- }, f) => /* @__PURE__ */ l(
47
+ scrollRegionLabel: i,
48
+ style: b,
49
+ ...f
50
+ }, m) => /* @__PURE__ */ l(
50
51
  "div",
51
52
  {
52
53
  className: d(
@@ -56,27 +57,31 @@ const m = c(
56
57
  "data-slot": "table-container",
57
58
  ...s ? {
58
59
  role: "region",
59
- "aria-label": n ?? "Scrollable table",
60
+ "aria-label": i ?? "Scrollable table",
60
61
  tabIndex: 0
61
62
  } : void 0,
62
63
  children: /* @__PURE__ */ l(
63
64
  "table",
64
65
  {
65
- ref: f,
66
- className: d("w-full caption-bottom text-sm", a),
66
+ ref: m,
67
+ className: d(
68
+ "w-full caption-bottom text-sm",
69
+ n === "fixed" && "table-fixed",
70
+ a
71
+ ),
67
72
  "data-hook": t,
68
73
  "data-slot": "table",
69
74
  "data-tracking-el": e,
70
75
  "data-tracking-label": o,
71
- style: { minWidth: s, ...i },
72
- ...b
76
+ style: { minWidth: s, ...b },
77
+ ...f
73
78
  }
74
79
  )
75
80
  }
76
81
  )
77
82
  );
78
- p.displayName = "Table";
79
- const g = r.forwardRef(
83
+ g.displayName = "Table";
84
+ const h = r.forwardRef(
80
85
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
81
86
  "thead",
82
87
  {
@@ -88,8 +93,8 @@ const g = r.forwardRef(
88
93
  }
89
94
  )
90
95
  );
91
- g.displayName = "TableHeader";
92
- const h = r.forwardRef(
96
+ h.displayName = "TableHeader";
97
+ const w = r.forwardRef(
93
98
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
94
99
  "tbody",
95
100
  {
@@ -101,8 +106,8 @@ const h = r.forwardRef(
101
106
  }
102
107
  )
103
108
  );
104
- h.displayName = "TableBody";
105
- const w = r.forwardRef(
109
+ w.displayName = "TableBody";
110
+ const x = r.forwardRef(
106
111
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
107
112
  "tfoot",
108
113
  {
@@ -114,7 +119,7 @@ const w = r.forwardRef(
114
119
  }
115
120
  )
116
121
  );
117
- w.displayName = "TableFooter";
122
+ x.displayName = "TableFooter";
118
123
  const N = r.forwardRef(
119
124
  ({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
120
125
  "tr",
@@ -131,36 +136,45 @@ const N = r.forwardRef(
131
136
  )
132
137
  );
133
138
  N.displayName = "TableRow";
134
- const x = r.forwardRef(
135
- ({ className: a, dataHook: t, align: e, minWidth: o, style: s, scope: n = "col", ...i }, b) => /* @__PURE__ */ l(
139
+ const y = r.forwardRef(
140
+ ({
141
+ className: a,
142
+ dataHook: t,
143
+ align: e,
144
+ width: o,
145
+ minWidth: n,
146
+ style: s,
147
+ scope: i = "col",
148
+ ...b
149
+ }, f) => /* @__PURE__ */ l(
136
150
  "th",
137
151
  {
138
- ref: b,
139
- className: d(u({ align: e }), a),
152
+ ref: f,
153
+ className: d(p({ align: e }), a),
140
154
  "data-hook": t,
141
155
  "data-slot": "table-head",
142
- scope: n,
143
- style: { minWidth: o, ...s },
144
- ...i
156
+ scope: i,
157
+ style: { width: o, minWidth: n, ...s },
158
+ ...b
145
159
  }
146
160
  )
147
161
  );
148
- x.displayName = "TableHead";
149
- const y = r.forwardRef(
150
- ({ className: a, dataHook: t, size: e, align: o, minWidth: s, style: n, ...i }, b) => /* @__PURE__ */ l(
162
+ y.displayName = "TableHead";
163
+ const T = r.forwardRef(
164
+ ({ className: a, dataHook: t, size: e, align: o, width: n, minWidth: s, style: i, ...b }, f) => /* @__PURE__ */ l(
151
165
  "td",
152
166
  {
153
- ref: b,
154
- className: d(m({ size: e, align: o }), a),
167
+ ref: f,
168
+ className: d(u({ size: e, align: o }), a),
155
169
  "data-hook": t,
156
170
  "data-slot": "table-cell",
157
- style: { minWidth: s, ...n },
158
- ...i
171
+ style: { width: n, minWidth: s, ...i },
172
+ ...b
159
173
  }
160
174
  )
161
175
  );
162
- y.displayName = "TableCell";
163
- const T = r.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
176
+ T.displayName = "TableCell";
177
+ const k = r.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__ */ l(
164
178
  "caption",
165
179
  {
166
180
  ref: o,
@@ -170,14 +184,14 @@ const T = r.forwardRef(({ className: a, dataHook: t, ...e }, o) => /* @__PURE__
170
184
  ...e
171
185
  }
172
186
  ));
173
- T.displayName = "TableCaption";
187
+ k.displayName = "TableCaption";
174
188
  export {
175
- p as Table,
176
- h as TableBody,
177
- T as TableCaption,
178
- y as TableCell,
179
- w as TableFooter,
180
- x as TableHead,
181
- g as TableHeader,
189
+ g as Table,
190
+ w as TableBody,
191
+ k as TableCaption,
192
+ T as TableCell,
193
+ x as TableFooter,
194
+ y as TableHead,
195
+ h as TableHeader,
182
196
  N as TableRow
183
197
  };
package/dist/tooltip.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),T=require("react"),x=require("@radix-ui/react-tooltip"),m=require("@brightlocal/ui-components/lib/utils");function l(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,i.get?i:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const n=l(T),a=l(x);function y({delayDuration:t=0,skipDelayDuration:o=0,...e}){return r.jsx(a.Provider,{"data-slot":"tooltip-provider",delayDuration:t,skipDelayDuration:o,...e})}function j({...t}){return r.jsx(a.Root,{"data-slot":"tooltip",...t})}const s=n.forwardRef(({...t},o)=>r.jsx(a.Trigger,{ref:o,"data-slot":"tooltip-trigger",...t}));s.displayName="TooltipTrigger";const d=n.forwardRef(({className:t,sideOffset:o=0,dataHook:e,trackingEl:i,trackingLabel:p,hideArrow:c=!1,children:u,...g},f)=>r.jsx(a.Portal,{children:r.jsxs(a.Content,{ref:f,className:m.cn("bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal","data-[side=bottom]:[&_[data-slot=tooltip-arrow]]:translate-y-px data-[side=left]:[&_[data-slot=tooltip-arrow]]:-translate-x-px data-[side=right]:[&_[data-slot=tooltip-arrow]]:translate-x-px data-[side=top]:[&_[data-slot=tooltip-arrow]]:-translate-y-px",t),"data-hook":e,"data-slot":"tooltip-content","data-tracking-el":i,"data-tracking-label":p,sideOffset:o,...g,children:[u,!c&&r.jsx(a.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));d.displayName="TooltipContent";exports.Tooltip=j;exports.TooltipContent=d;exports.TooltipProvider=y;exports.TooltipTrigger=s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-tooltip"),l=require("@brightlocal/ui-components/lib/utils");function s(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const e in t)if(e!=="default"){const r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(o,e,r.get?r:{enumerable:!0,get:()=>t[e]})}}return o.default=t,Object.freeze(o)}const c=s(m),i=s(x);function j({delayDuration:t=0,skipDelayDuration:o=0,...e}){return a.jsx(i.Provider,{delayDuration:t,skipDelayDuration:o,...e})}function y({...t}){return a.jsx(i.Root,{...t})}const d=c.forwardRef(({dataHook:t,trackingEl:o,trackingLabel:e,...r},n)=>a.jsx(i.Trigger,{ref:n,"data-hook":t,"data-slot":"tooltip-trigger","data-tracking-el":o,"data-tracking-label":e,...r}));d.displayName="TooltipTrigger";const p=c.forwardRef(({className:t,sideOffset:o=0,dataHook:e,trackingEl:r,trackingLabel:n,hideArrow:u=!1,children:g,...T},f)=>a.jsx(i.Portal,{children:a.jsxs(i.Content,{ref:f,className:l.cn("bg-secondary text-secondary-foreground z-50 w-max max-w-sm rounded-md px-3 py-1.5 text-xs leading-4 font-normal",l.FLOATING_CONTENT_ANIMATION,"**:data-[slot=tooltip-arrow]:-translate-y-px",t),"data-hook":e,"data-slot":"tooltip-content","data-tracking-el":r,"data-tracking-label":n,sideOffset:o,...T,children:[g,!u&&a.jsx(i.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));p.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=p;exports.TooltipProvider=j;exports.TooltipTrigger=d;
package/dist/tooltip.d.ts CHANGED
@@ -41,7 +41,26 @@ declare function TooltipProvider({ delayDuration, skipDelayDuration, ...props }:
41
41
  * multiple tooltips.
42
42
  */
43
43
  declare function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
44
- declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipPrimitive.TooltipTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
44
+ interface TooltipTriggerProps extends React.ComponentProps<typeof TooltipPrimitive.Trigger> {
45
+ /**
46
+ * Data hook for automated testing, rendered as the `data-hook` attribute
47
+ * (the platform test-selector contract).
48
+ *
49
+ * Optional because `TooltipTrigger` is commonly used with `asChild`, where the
50
+ * child element (e.g. a `Button`) already carries its own `dataHook`. When
51
+ * `asChild` is set, the child's `data-hook` wins over this one.
52
+ */
53
+ dataHook?: string;
54
+ /**
55
+ * Optional analytics element identifier
56
+ */
57
+ trackingEl?: string;
58
+ /**
59
+ * Optional analytics label context
60
+ */
61
+ trackingLabel?: string;
62
+ }
63
+ declare const TooltipTrigger: React.ForwardRefExoticComponent<Omit<TooltipTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
45
64
  interface TooltipContentProps extends React.ComponentProps<typeof TooltipPrimitive.Content> {
46
65
  /**
47
66
  * Required data-hook attribute for testing and analytics
@@ -62,5 +81,5 @@ interface TooltipContentProps extends React.ComponentProps<typeof TooltipPrimiti
62
81
  }
63
82
  declare const TooltipContent: React.ForwardRefExoticComponent<Omit<TooltipContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
64
83
  export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
65
- export type { TooltipContentProps, TooltipProviderProps };
84
+ export type { TooltipContentProps, TooltipProviderProps, TooltipTriggerProps };
66
85
  //# sourceMappingURL=tooltip.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../src/components/tooltip.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAI5D,UAAU,oBAAqB,SAAQ,KAAK,CAAC,cAAc,CACzD,OAAO,gBAAgB,CAAC,QAAQ,CACjC;IACC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,iBAAS,eAAe,CAAC,EACvB,aAAiB,EACjB,iBAAqB,EACrB,GAAG,KAAK,EACT,EAAE,oBAAoB,2CAStB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,iBAAS,OAAO,CAAC,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,2CAEpD;AAED,QAAA,MAAM,cAAc,sKAWlB,CAAC;AAIH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,cAAc,CACxD,OAAO,gBAAgB,CAAC,OAAO,CAChC;IACC;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAA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,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,cAAc,yGA+CnB,CAAC;AAIF,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AACpE,YAAY,EAAE,mBAAmB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,CAAC"}
package/dist/tooltip.js CHANGED
@@ -1,64 +1,67 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
2
- import * as i from "react";
1
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
2
+ import * as n from "react";
3
3
  import * as o from "@radix-ui/react-tooltip";
4
- import { cn as f } from "@brightlocal/ui-components/lib/utils";
5
- function u({
4
+ import { cn as g, FLOATING_CONTENT_ANIMATION as f } from "@brightlocal/ui-components/lib/utils";
5
+ function w({
6
6
  delayDuration: t = 0,
7
- skipDelayDuration: a = 0,
8
- ...e
7
+ skipDelayDuration: r = 0,
8
+ ...a
9
9
  }) {
10
- return /* @__PURE__ */ r(
10
+ return /* @__PURE__ */ e(
11
11
  o.Provider,
12
12
  {
13
- "data-slot": "tooltip-provider",
14
13
  delayDuration: t,
15
- skipDelayDuration: a,
16
- ...e
14
+ skipDelayDuration: r,
15
+ ...a
17
16
  }
18
17
  );
19
18
  }
20
- function y({
19
+ function h({
21
20
  ...t
22
21
  }) {
23
- return /* @__PURE__ */ r(o.Root, { "data-slot": "tooltip", ...t });
22
+ return /* @__PURE__ */ e(o.Root, { ...t });
24
23
  }
25
- const g = i.forwardRef(({ ...t }, a) => /* @__PURE__ */ r(
24
+ const T = n.forwardRef(({ dataHook: t, trackingEl: r, trackingLabel: a, ...i }, l) => /* @__PURE__ */ e(
26
25
  o.Trigger,
27
26
  {
28
- ref: a,
27
+ ref: l,
28
+ "data-hook": t,
29
29
  "data-slot": "tooltip-trigger",
30
- ...t
30
+ "data-tracking-el": r,
31
+ "data-tracking-label": a,
32
+ ...i
31
33
  }
32
34
  ));
33
- g.displayName = "TooltipTrigger";
34
- const x = i.forwardRef(
35
+ T.displayName = "TooltipTrigger";
36
+ const x = n.forwardRef(
35
37
  ({
36
38
  className: t,
37
- sideOffset: a = 0,
38
- dataHook: e,
39
- trackingEl: l,
40
- trackingLabel: d,
41
- hideArrow: n = !1,
39
+ sideOffset: r = 0,
40
+ dataHook: a,
41
+ trackingEl: i,
42
+ trackingLabel: l,
43
+ hideArrow: d = !1,
42
44
  children: s,
43
45
  ...p
44
- }, c) => /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ m(
46
+ }, c) => /* @__PURE__ */ e(o.Portal, { children: /* @__PURE__ */ m(
45
47
  o.Content,
46
48
  {
47
49
  ref: c,
48
- className: f(
49
- "bg-secondary text-secondary-foreground z-50 rounded-md px-3 py-1.5 text-xs leading-4 font-normal",
50
- "data-[side=bottom]:[&_[data-slot=tooltip-arrow]]:translate-y-px data-[side=left]:[&_[data-slot=tooltip-arrow]]:-translate-x-px data-[side=right]:[&_[data-slot=tooltip-arrow]]:translate-x-px data-[side=top]:[&_[data-slot=tooltip-arrow]]:-translate-y-px",
50
+ className: g(
51
+ "bg-secondary text-secondary-foreground z-50 w-max max-w-sm rounded-md px-3 py-1.5 text-xs leading-4 font-normal",
52
+ f,
53
+ "**:data-[slot=tooltip-arrow]:-translate-y-px",
51
54
  t
52
55
  ),
53
- "data-hook": e,
56
+ "data-hook": a,
54
57
  "data-slot": "tooltip-content",
55
- "data-tracking-el": l,
56
- "data-tracking-label": d,
57
- sideOffset: a,
58
+ "data-tracking-el": i,
59
+ "data-tracking-label": l,
60
+ sideOffset: r,
58
61
  ...p,
59
62
  children: [
60
63
  s,
61
- !n && /* @__PURE__ */ r(
64
+ !d && /* @__PURE__ */ e(
62
65
  o.Arrow,
63
66
  {
64
67
  className: "fill-secondary",
@@ -73,8 +76,8 @@ const x = i.forwardRef(
73
76
  );
74
77
  x.displayName = "TooltipContent";
75
78
  export {
76
- y as Tooltip,
79
+ h as Tooltip,
77
80
  x as TooltipContent,
78
- u as TooltipProvider,
79
- g as TooltipTrigger
81
+ w as TooltipProvider,
82
+ T as TooltipTrigger
80
83
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.21.0",
3
+ "version": "2.23.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -28,6 +28,7 @@ import {
28
28
  type ExpandedState,
29
29
  type PaginationState,
30
30
  type Row,
31
+ type RowData,
31
32
  type RowSelectionState,
32
33
  type SortingState,
33
34
  type Table as TanStackTable,
@@ -39,6 +40,16 @@ import {
39
40
  getSortedRowModel,
40
41
  useReactTable,
41
42
  } from "@tanstack/react-table";
43
+
44
+ declare module "@tanstack/react-table" {
45
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
46
+ interface ColumnMeta<TData extends RowData, TValue> {
47
+ /** Explicit column width (e.g., "200px", "50%", "10rem"). */
48
+ width?: string;
49
+ /** Minimum column width (e.g., "100px", "8rem"). */
50
+ minWidth?: string;
51
+ }
52
+ }
42
53
  import { useVirtualizer } from "@tanstack/react-virtual";
43
54
  import { ArrowDown, ArrowUp, ArrowUpDown, Search, X } from "@brightlocal/icons";
44
55
 
@@ -400,6 +411,30 @@ export interface DataTableProps<TData> {
400
411
  stickyHeader?: boolean;
401
412
  /** Additional class name for the outer wrapper. */
402
413
  className?: string;
414
+ /**
415
+ * Table layout algorithm.
416
+ * - `"auto"` (default) — browser sizes columns based on content.
417
+ * - `"fixed"` — columns respect explicit `width` values on `TableHead`/`TableCell`
418
+ * and split remaining space equally. Use when you set `width` on headers.
419
+ *
420
+ * **Migration note:** `"fixed"` will become the default in the next major release.
421
+ * Consumers should start setting explicit `width` on columns now.
422
+ * @default "auto"
423
+ */
424
+ layout?: "auto" | "fixed";
425
+ /**
426
+ * Minimum width for the table (e.g., "1100px", "60rem"). Prevents columns
427
+ * from compressing on narrow viewports and enables horizontal scroll.
428
+ * When set, the scroll container becomes a focusable region for
429
+ * keyboard accessibility.
430
+ */
431
+ minWidth?: string;
432
+ /**
433
+ * Accessible label for the scroll container region.
434
+ * Used when `minWidth` is set to provide context for keyboard users.
435
+ * @default "Scrollable table"
436
+ */
437
+ scrollRegionLabel?: string;
403
438
  /**
404
439
  * Optional footer rendered inside the `<table>` element after `<tbody>`.
405
440
  * Use for summary rows or totals. Pass a `<TableFooter>` with rows.
@@ -428,6 +463,9 @@ export function DataTable<TData>({
428
463
  noResultsMessage = "No results.",
429
464
  stickyHeader = false,
430
465
  className,
466
+ layout,
467
+ minWidth,
468
+ scrollRegionLabel,
431
469
  footer,
432
470
  }: DataTableProps<TData>) {
433
471
  const columnCount = table.getVisibleLeafColumns().length;
@@ -443,7 +481,12 @@ export function DataTable<TData>({
443
481
  data-tracking-el={trackingEl}
444
482
  data-tracking-label={trackingLabel}
445
483
  >
446
- <Table dataHook={`${dataHook}-table`}>
484
+ <Table
485
+ dataHook={`${dataHook}-table`}
486
+ layout={layout}
487
+ minWidth={minWidth}
488
+ scrollRegionLabel={scrollRegionLabel}
489
+ >
447
490
  <DataTableHeaderRows stickyHeader={stickyHeader} table={table} />
448
491
  <TableBody>
449
492
  {isLoading ? (
@@ -468,7 +511,7 @@ export function DataTable<TData>({
468
511
  .rows.map((row) => <DataTableRow key={row.id} row={row} />)
469
512
  ) : (
470
513
  <TableRow>
471
- <TableCell colSpan={columnCount}>
514
+ <TableCell align="center" colSpan={columnCount} size="lg">
472
515
  <div aria-live="polite" role="status">
473
516
  {noResultsMessage}
474
517
  </div>
@@ -515,11 +558,14 @@ function DataTableHeaderRows<TData>({
515
558
  : header.column.getCanSort()
516
559
  ? "none"
517
560
  : undefined;
561
+ const meta = header.column.columnDef.meta;
518
562
  return (
519
563
  <TableHead
520
564
  key={header.id}
521
565
  aria-sort={ariaSort}
522
566
  colSpan={header.colSpan}
567
+ minWidth={meta?.minWidth}
568
+ width={meta?.width}
523
569
  >
524
570
  {header.isPlaceholder
525
571
  ? null
@@ -646,6 +692,9 @@ export function VirtualizedDataTable<TData>({
646
692
  noResultsMessage = "No results.",
647
693
  stickyHeader = false,
648
694
  className,
695
+ layout,
696
+ minWidth,
697
+ scrollRegionLabel,
649
698
  footer,
650
699
  height,
651
700
  estimateSize = 48,
@@ -688,7 +737,12 @@ export function VirtualizedDataTable<TData>({
688
737
  data-tracking-label={trackingLabel}
689
738
  style={height != null ? { height } : undefined}
690
739
  >
691
- <Table dataHook={`${dataHook}-table`}>
740
+ <Table
741
+ dataHook={`${dataHook}-table`}
742
+ layout={layout}
743
+ minWidth={minWidth}
744
+ scrollRegionLabel={scrollRegionLabel}
745
+ >
692
746
  <DataTableHeaderRows stickyHeader={stickyHeader} table={table} />
693
747
  <TableBody>
694
748
  {isLoading ? (
@@ -724,7 +778,7 @@ export function VirtualizedDataTable<TData>({
724
778
  </>
725
779
  ) : (
726
780
  <TableRow>
727
- <TableCell colSpan={columnCount}>
781
+ <TableCell align="center" colSpan={columnCount} size="lg">
728
782
  <div aria-live="polite" role="status">
729
783
  {noResultsMessage}
730
784
  </div>
@@ -9,15 +9,11 @@ const alertVariants = cva(
9
9
  {
10
10
  variants: {
11
11
  variant: {
12
- default:
13
- "bg-neutral-100 text-neutral-900 dark:bg-neutral-800 dark:text-neutral-100",
14
- success:
15
- "bg-green-200 text-green-900 dark:bg-green-950 dark:text-green-200",
16
- info: "bg-cyan-200 text-cyan-900 dark:bg-cyan-900 dark:text-cyan-200",
17
- destructive:
18
- "bg-red-300 text-red-950 dark:bg-red-950 dark:text-red-300",
19
- warning:
20
- "bg-orange-200 text-amber-900 dark:bg-amber-900 dark:text-orange-200",
12
+ default: "bg-muted text-foreground",
13
+ success: "bg-success-background text-success-foreground",
14
+ info: "bg-info-background text-info-foreground",
15
+ destructive: "bg-destructive text-destructive-foreground",
16
+ warning: "bg-warning-background text-warning-foreground",
21
17
  },
22
18
  },
23
19
  defaultVariants: {
@@ -118,7 +114,7 @@ function AlertSuccess({
118
114
  data-tracking-label={trackingLabel}
119
115
  variant="success"
120
116
  >
121
- <CircleCheck className="shrink-0 translate-y-0.5 text-green-900 dark:text-green-200" />
117
+ <CircleCheck className="text-success-foreground shrink-0 translate-y-0.5" />
122
118
  <div className="flex min-w-0 flex-1 flex-col gap-1">
123
119
  {title && <AlertTitle>{title}</AlertTitle>}
124
120
  <AlertDescription>{description}</AlertDescription>
@@ -145,7 +141,7 @@ function AlertInfo({
145
141
  data-tracking-label={trackingLabel}
146
142
  variant="info"
147
143
  >
148
- <Info className="shrink-0 translate-y-0.5 text-cyan-900 dark:text-cyan-200" />
144
+ <Info className="text-info-foreground shrink-0 translate-y-0.5" />
149
145
  <div className="flex min-w-0 flex-1 flex-col gap-1">
150
146
  {title && <AlertTitle>{title}</AlertTitle>}
151
147
  <AlertDescription>{description}</AlertDescription>
@@ -172,7 +168,7 @@ function AlertDestructive({
172
168
  data-tracking-label={trackingLabel}
173
169
  variant="destructive"
174
170
  >
175
- <CircleX className="shrink-0 translate-y-0.5 text-red-950 dark:text-red-300" />
171
+ <CircleX className="text-destructive-foreground shrink-0 translate-y-0.5" />
176
172
  <div className="flex min-w-0 flex-1 flex-col gap-1">
177
173
  {title && <AlertTitle>{title}</AlertTitle>}
178
174
  <AlertDescription>{description}</AlertDescription>
@@ -199,7 +195,7 @@ function AlertWarning({
199
195
  data-tracking-label={trackingLabel}
200
196
  variant="warning"
201
197
  >
202
- <TriangleAlert className="shrink-0 translate-y-0.5 text-amber-900 dark:text-orange-200" />
198
+ <TriangleAlert className="text-warning-foreground shrink-0 translate-y-0.5" />
203
199
  <div className="flex min-w-0 flex-1 flex-col gap-1">
204
200
  {title && <AlertTitle>{title}</AlertTitle>}
205
201
  <AlertDescription>{description}</AlertDescription>
@@ -3,7 +3,10 @@ import * as React from "react";
3
3
  import * as ContextMenuPrimitive from "@radix-ui/react-context-menu";
4
4
  import { Check, ChevronRight, Circle } from "@brightlocal/icons";
5
5
 
6
- import { cn } from "@brightlocal/ui-components/lib/utils";
6
+ import {
7
+ cn,
8
+ FLOATING_CONTENT_ANIMATION,
9
+ } from "@brightlocal/ui-components/lib/utils";
7
10
  import { useOverlayPointerLock } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
8
11
 
9
12
  /**
@@ -199,7 +202,8 @@ const ContextMenuSubContent = React.forwardRef<
199
202
  <ContextMenuPrimitive.SubContent
200
203
  ref={ref}
201
204
  className={cn(
202
- "border-border bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
205
+ "border-border bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
206
+ FLOATING_CONTENT_ANIMATION,
203
207
  className
204
208
  )}
205
209
  data-slot="context-menu-sub-content"
@@ -230,7 +234,8 @@ const ContextMenuContent = React.forwardRef<
230
234
  <ContextMenuPrimitive.Content
231
235
  ref={ref}
232
236
  className={cn(
233
- "border-border bg-popover text-popover-foreground animate-in fade-in-80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
237
+ "border-border bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-md",
238
+ FLOATING_CONTENT_ANIMATION,
234
239
  className
235
240
  )}
236
241
  data-slot="context-menu-content"
@@ -9,7 +9,10 @@ import {
9
9
  ChevronsUpDown,
10
10
  } from "@brightlocal/icons";
11
11
 
12
- import { cn } from "@brightlocal/ui-components/lib/utils";
12
+ import {
13
+ cn,
14
+ FLOATING_CONTENT_ANIMATION,
15
+ } from "@brightlocal/ui-components/lib/utils";
13
16
  import { useOverlayPointerLock } from "@brightlocal/ui-components/hooks/use-overlay-pointer-lock";
14
17
 
15
18
  /**
@@ -125,13 +128,7 @@ const DropdownMenuContent = React.forwardRef<
125
128
  "overflow-x-hidden overflow-y-auto",
126
129
  "rounded-md border p-1 shadow-md",
127
130
  // Animations
128
- "data-[state=open]:animate-in data-[state=closed]:animate-out",
129
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
130
- "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
131
- "data-[side=bottom]:slide-in-from-top-2",
132
- "data-[side=left]:slide-in-from-right-2",
133
- "data-[side=right]:slide-in-from-left-2",
134
- "data-[side=top]:slide-in-from-bottom-2",
131
+ FLOATING_CONTENT_ANIMATION,
135
132
  ],
136
133
  className
137
134
  )}
@@ -545,13 +542,7 @@ const DropdownMenuSubContent = React.forwardRef<
545
542
  "origin-(--radix-dropdown-menu-content-transform-origin)",
546
543
  "overflow-hidden rounded-md border p-1 shadow-lg",
547
544
  // Animations
548
- "data-[state=open]:animate-in data-[state=closed]:animate-out",
549
- "data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
550
- "data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
551
- "data-[side=bottom]:slide-in-from-top-2",
552
- "data-[side=left]:slide-in-from-right-2",
553
- "data-[side=right]:slide-in-from-left-2",
554
- "data-[side=top]:slide-in-from-bottom-2",
545
+ FLOATING_CONTENT_ANIMATION,
555
546
  ],
556
547
  className
557
548
  )}