@brightlocal/ui-components 2.20.0 → 2.22.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 (66) hide show
  1. package/AI_USAGE.md +2 -0
  2. package/README.md +26 -13
  3. package/component-meta.json +41 -14
  4. package/dist/blocks/data-table.cjs +1 -1
  5. package/dist/blocks/data-table.d.ts +35 -3
  6. package/dist/blocks/data-table.d.ts.map +1 -1
  7. package/dist/blocks/data-table.js +178 -154
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts +2 -2
  10. package/dist/blocks/sidebar.js +18 -18
  11. package/dist/breadcrumb.cjs +1 -1
  12. package/dist/breadcrumb.d.ts +1 -1
  13. package/dist/breadcrumb.d.ts.map +1 -1
  14. package/dist/breadcrumb.js +9 -6
  15. package/dist/button.cjs +1 -1
  16. package/dist/button.d.ts.map +1 -1
  17. package/dist/button.js +12 -12
  18. package/dist/hover-card.cjs +1 -1
  19. package/dist/hover-card.d.ts.map +1 -1
  20. package/dist/hover-card.js +45 -45
  21. package/dist/index.cjs +1 -1
  22. package/dist/index.js +69 -68
  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/logo.cjs +1 -1
  28. package/dist/logo.d.ts +1 -1
  29. package/dist/logo.js +2 -2
  30. package/dist/navigation-menu.cjs +1 -1
  31. package/dist/navigation-menu.d.ts +17 -0
  32. package/dist/navigation-menu.d.ts.map +1 -1
  33. package/dist/navigation-menu.js +120 -90
  34. package/dist/pagination.cjs +1 -1
  35. package/dist/pagination.d.ts +12 -8
  36. package/dist/pagination.d.ts.map +1 -1
  37. package/dist/pagination.js +117 -113
  38. package/dist/progress.cjs +1 -1
  39. package/dist/progress.d.ts +28 -2
  40. package/dist/progress.d.ts.map +1 -1
  41. package/dist/progress.js +90 -49
  42. package/dist/skeleton.cjs +1 -1
  43. package/dist/skeleton.js +1 -1
  44. package/dist/sonner.d.ts +1 -1
  45. package/dist/table.cjs +1 -1
  46. package/dist/table.d.ts +22 -2
  47. package/dist/table.d.ts.map +1 -1
  48. package/dist/table.js +57 -43
  49. package/dist/tooltip.cjs +1 -1
  50. package/dist/tooltip.d.ts.map +1 -1
  51. package/dist/tooltip.js +36 -36
  52. package/package.json +7 -3
  53. package/src/blocks/data-table.tsx +56 -4
  54. package/src/blocks/sidebar.tsx +5 -5
  55. package/src/components/breadcrumb.tsx +6 -3
  56. package/src/components/button.tsx +7 -1
  57. package/src/components/hover-card.tsx +6 -3
  58. package/src/components/logo.tsx +3 -3
  59. package/src/components/navigation-menu.tsx +113 -32
  60. package/src/components/pagination.tsx +47 -67
  61. package/src/components/progress.tsx +118 -14
  62. package/src/components/skeleton.tsx +1 -1
  63. package/src/components/sonner.tsx +1 -1
  64. package/src/components/table.tsx +44 -7
  65. package/src/components/tooltip.tsx +8 -5
  66. 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;IAClB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,QAAA,MA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AM,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 r=require("react/jsx-runtime"),m=require("react"),x=require("@radix-ui/react-tooltip"),a=require("@brightlocal/ui-components/lib/utils");function l(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const o in t)if(o!=="default"){const n=Object.getOwnPropertyDescriptor(t,o);Object.defineProperty(e,o,n.get?n:{enumerable:!0,get:()=>t[o]})}}return e.default=t,Object.freeze(e)}const s=l(m),i=l(x);function j({delayDuration:t=0,skipDelayDuration:e=0,...o}){return r.jsx(i.Provider,{delayDuration:t,skipDelayDuration:e,...o})}function y({...t}){return r.jsx(i.Root,{...t})}const c=s.forwardRef(({...t},e)=>r.jsx(i.Trigger,{ref:e,"data-slot":"tooltip-trigger",...t}));c.displayName="TooltipTrigger";const d=s.forwardRef(({className:t,sideOffset:e=0,dataHook:o,trackingEl:n,trackingLabel:p,hideArrow:u=!1,children:g,...T},f)=>r.jsx(i.Portal,{children:r.jsxs(i.Content,{ref:f,className:a.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",a.FLOATING_CONTENT_ANIMATION,"**:data-[slot=tooltip-arrow]:-translate-y-px",t),"data-hook":o,"data-slot":"tooltip-content","data-tracking-el":n,"data-tracking-label":p,sideOffset:e,...T,children:[g,!u&&r.jsx(i.Arrow,{className:"fill-secondary","data-slot":"tooltip-arrow",height:7,width:14})]})}));d.displayName="TooltipContent";exports.Tooltip=y;exports.TooltipContent=d;exports.TooltipProvider=j;exports.TooltipTrigger=c;
@@ -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,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,cAAc,yGA8CnB,CAAC;AAIF,OAA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1,65 +1,65 @@
1
- import { jsx as r, jsxs as m } from "react/jsx-runtime";
1
+ import { jsx as a, jsxs as c } from "react/jsx-runtime";
2
2
  import * as i from "react";
3
- import * as o from "@radix-ui/react-tooltip";
4
- import { cn as f } from "@brightlocal/ui-components/lib/utils";
5
- function u({
6
- delayDuration: t = 0,
7
- skipDelayDuration: a = 0,
3
+ import * as t from "@radix-ui/react-tooltip";
4
+ import { cn as f, FLOATING_CONTENT_ANIMATION as g } from "@brightlocal/ui-components/lib/utils";
5
+ function w({
6
+ delayDuration: o = 0,
7
+ skipDelayDuration: r = 0,
8
8
  ...e
9
9
  }) {
10
- return /* @__PURE__ */ r(
11
- o.Provider,
10
+ return /* @__PURE__ */ a(
11
+ t.Provider,
12
12
  {
13
- "data-slot": "tooltip-provider",
14
- delayDuration: t,
15
- skipDelayDuration: a,
13
+ delayDuration: o,
14
+ skipDelayDuration: r,
16
15
  ...e
17
16
  }
18
17
  );
19
18
  }
20
19
  function y({
21
- ...t
20
+ ...o
22
21
  }) {
23
- return /* @__PURE__ */ r(o.Root, { "data-slot": "tooltip", ...t });
22
+ return /* @__PURE__ */ a(t.Root, { ...o });
24
23
  }
25
- const g = i.forwardRef(({ ...t }, a) => /* @__PURE__ */ r(
26
- o.Trigger,
24
+ const T = i.forwardRef(({ ...o }, r) => /* @__PURE__ */ a(
25
+ t.Trigger,
27
26
  {
28
- ref: a,
27
+ ref: r,
29
28
  "data-slot": "tooltip-trigger",
30
- ...t
29
+ ...o
31
30
  }
32
31
  ));
33
- g.displayName = "TooltipTrigger";
32
+ T.displayName = "TooltipTrigger";
34
33
  const x = i.forwardRef(
35
34
  ({
36
- className: t,
37
- sideOffset: a = 0,
35
+ className: o,
36
+ sideOffset: r = 0,
38
37
  dataHook: e,
39
- trackingEl: l,
40
- trackingLabel: d,
41
- hideArrow: n = !1,
38
+ trackingEl: n,
39
+ trackingLabel: l,
40
+ hideArrow: d = !1,
42
41
  children: s,
43
42
  ...p
44
- }, c) => /* @__PURE__ */ r(o.Portal, { children: /* @__PURE__ */ m(
45
- o.Content,
43
+ }, m) => /* @__PURE__ */ a(t.Portal, { children: /* @__PURE__ */ c(
44
+ t.Content,
46
45
  {
47
- ref: c,
46
+ ref: m,
48
47
  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",
51
- t
48
+ "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",
49
+ g,
50
+ "**:data-[slot=tooltip-arrow]:-translate-y-px",
51
+ o
52
52
  ),
53
53
  "data-hook": e,
54
54
  "data-slot": "tooltip-content",
55
- "data-tracking-el": l,
56
- "data-tracking-label": d,
57
- sideOffset: a,
55
+ "data-tracking-el": n,
56
+ "data-tracking-label": l,
57
+ sideOffset: r,
58
58
  ...p,
59
59
  children: [
60
60
  s,
61
- !n && /* @__PURE__ */ r(
62
- o.Arrow,
61
+ !d && /* @__PURE__ */ a(
62
+ t.Arrow,
63
63
  {
64
64
  className: "fill-secondary",
65
65
  "data-slot": "tooltip-arrow",
@@ -75,6 +75,6 @@ x.displayName = "TooltipContent";
75
75
  export {
76
76
  y as Tooltip,
77
77
  x as TooltipContent,
78
- u as TooltipProvider,
79
- g as TooltipTrigger
78
+ w as TooltipProvider,
79
+ T as TooltipTrigger
80
80
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brightlocal/ui-components",
3
- "version": "2.20.0",
3
+ "version": "2.22.0",
4
4
  "description": "BrightLocal Design System UI Components",
5
5
  "type": "module",
6
6
  "private": false,
@@ -140,8 +140,8 @@
140
140
  "vite-bundle-visualizer": "^1.2.1",
141
141
  "vite-plugin-dts": "^4.5.4",
142
142
  "vite-plugin-lib-inject-css": "^2.2.2",
143
- "@workspace/typescript-config": "0.0.0",
144
- "@workspace/eslint-config": "0.0.0"
143
+ "@workspace/eslint-config": "0.0.0",
144
+ "@workspace/typescript-config": "0.0.0"
145
145
  },
146
146
  "publishConfig": {
147
147
  "access": "public",
@@ -228,6 +228,10 @@
228
228
  "deprecations:clear": "node scripts/deprecations-clear.mjs",
229
229
  "sync-meta": "node scripts/sync-component-meta.mjs",
230
230
  "sync-meta:check": "node scripts/sync-component-meta.mjs --check",
231
+ "token-drift": "node scripts/token-drift.mjs",
232
+ "token-drift:check": "node scripts/token-drift.mjs --check",
233
+ "token-drift:update-baseline": "node scripts/token-drift.mjs --update-baseline",
234
+ "token-drift:report": "node scripts/token-report.mjs",
231
235
  "audit-demos": "node scripts/audit-browser-demos.mjs",
232
236
  "audit-demos:check": "node scripts/audit-browser-demos.mjs --check",
233
237
  "build:changelog": "node scripts/generate-changelog.js",
@@ -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 ? (
@@ -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 ? (
@@ -1152,8 +1206,6 @@ function DataTablePaginationNav({
1152
1206
  const paginationItems = usePagination({
1153
1207
  page: info.currentPage,
1154
1208
  totalPages: info.totalPages,
1155
- siblingCount: 1,
1156
- boundaryCount: 1,
1157
1209
  });
1158
1210
 
1159
1211
  return (
@@ -520,7 +520,7 @@ interface SidebarTriggerProps extends Omit<
520
520
  dataHook?: string;
521
521
  /**
522
522
  * Accessible label for the toggle button.
523
- * @default "Toggle Sidebar"
523
+ * @default "Toggle sidebar"
524
524
  */
525
525
  toggleAriaLabel?: string;
526
526
  }
@@ -541,14 +541,14 @@ const SidebarTrigger = React.forwardRef<
541
541
  ref
542
542
  ) => {
543
543
  const { toggleSidebar } = useSidebar();
544
- const resolvedLabel = toggleAriaLabel ?? "Toggle Sidebar";
544
+ const resolvedLabel = toggleAriaLabel ?? "Toggle sidebar";
545
545
 
546
546
  return (
547
547
  <Button
548
548
  ref={ref}
549
549
  iconOnly
550
550
  aria-label={resolvedLabel}
551
- className={cn("h-7 w-7", className)}
551
+ className={cn("relative h-7 w-7", className)}
552
552
  data-slot="sidebar-trigger"
553
553
  dataHook={dataHook}
554
554
  size="sm"
@@ -573,7 +573,7 @@ SidebarTrigger.displayName = "SidebarTrigger";
573
573
  interface SidebarRailProps extends React.ComponentProps<"button"> {
574
574
  /**
575
575
  * Accessible label and tooltip for the rail toggle.
576
- * @default "Toggle Sidebar"
576
+ * @default "Toggle sidebar"
577
577
  */
578
578
  toggleAriaLabel?: string;
579
579
  }
@@ -581,7 +581,7 @@ interface SidebarRailProps extends React.ComponentProps<"button"> {
581
581
  const SidebarRail = React.forwardRef<HTMLButtonElement, SidebarRailProps>(
582
582
  ({ className, toggleAriaLabel, ...props }, ref) => {
583
583
  const { toggleSidebar } = useSidebar();
584
- const resolvedLabel = toggleAriaLabel ?? "Toggle Sidebar";
584
+ const resolvedLabel = toggleAriaLabel ?? "Toggle sidebar";
585
585
 
586
586
  return (
587
587
  <button
@@ -22,7 +22,7 @@ interface BreadcrumbProps extends React.ComponentProps<"nav"> {
22
22
  trackingLabel?: string;
23
23
  /**
24
24
  * Accessible label for the breadcrumb navigation.
25
- * @default "breadcrumb"
25
+ * @default "Breadcrumb"
26
26
  */
27
27
  ariaLabel?: string;
28
28
  }
@@ -36,7 +36,7 @@ const Breadcrumb = React.forwardRef<HTMLElement, BreadcrumbProps>(
36
36
  return (
37
37
  <nav
38
38
  ref={ref}
39
- aria-label={ariaLabel ?? "breadcrumb"}
39
+ aria-label={ariaLabel ?? "Breadcrumb"}
40
40
  data-hook={dataHook}
41
41
  data-slot="breadcrumb"
42
42
  data-tracking-el={trackingEl}
@@ -181,7 +181,10 @@ const BreadcrumbEllipsis = React.forwardRef<
181
181
  <span
182
182
  ref={ref}
183
183
  aria-hidden="true"
184
- className={cn("flex size-9 items-center justify-center", className)}
184
+ className={cn(
185
+ "relative flex size-9 items-center justify-center",
186
+ className
187
+ )}
185
188
  data-slot="breadcrumb-ellipsis"
186
189
  role="presentation"
187
190
  {...props}
@@ -203,9 +203,15 @@ const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
203
203
  else if (disabled) visualState = "disabled";
204
204
 
205
205
  // Ensure we always have an accessible label
206
+ const childrenIsPrimitive =
207
+ typeof children === "string" || typeof children === "number";
206
208
  const effectiveAriaLabel =
207
209
  ariaLabel ??
208
- (loading ? `Loading: ${children || "Please wait"}` : undefined);
210
+ (loading
211
+ ? childrenIsPrimitive
212
+ ? `Loading: ${children}`
213
+ : "Loading"
214
+ : undefined);
209
215
 
210
216
  // When asChild is used, render a simplified version that only forwards props
211
217
  if (asChild) {
@@ -2,7 +2,10 @@
2
2
 
3
3
  import * as React from "react";
4
4
  import * as HoverCardPrimitive from "@radix-ui/react-hover-card";
5
- import { cn } from "@brightlocal/ui-components/lib/utils";
5
+ import {
6
+ cn,
7
+ FLOATING_CONTENT_ANIMATION,
8
+ } from "@brightlocal/ui-components/lib/utils";
6
9
 
7
10
  /**
8
11
  * HoverCard props
@@ -142,8 +145,8 @@ const HoverCardContent = React.forwardRef<
142
145
  ref={ref}
143
146
  align={align}
144
147
  className={cn(
145
- "border-border bg-popover text-popover-foreground z-50 w-80 rounded-lg border p-4 shadow-md outline-hidden",
146
- "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",
148
+ "border-border bg-popover text-popover-foreground z-50 w-max max-w-sm rounded-lg border p-4 shadow-md outline-hidden",
149
+ FLOATING_CONTENT_ANIMATION,
147
150
  className
148
151
  )}
149
152
  data-hook={dataHook}
@@ -30,7 +30,7 @@ interface LogoProps
30
30
  dataHook: string;
31
31
  /**
32
32
  * Accessible label for the logo image.
33
- * @default "BrightLocal Logo"
33
+ * @default "BrightLocal logo"
34
34
  */
35
35
  ariaLabel?: string;
36
36
  /**
@@ -64,7 +64,7 @@ function Logo({
64
64
  >
65
65
  {variant === "logotype" && (
66
66
  <svg
67
- aria-label={ariaLabel ?? "BrightLocal Logo"}
67
+ aria-label={ariaLabel ?? "BrightLocal logo"}
68
68
  fill="none"
69
69
  height="24"
70
70
  role="img"
@@ -82,7 +82,7 @@ function Logo({
82
82
  )}
83
83
  {variant === "mark" && (
84
84
  <svg
85
- aria-label={ariaLabel ?? "BrightLocal Logo"}
85
+ aria-label={ariaLabel ?? "BrightLocal logo"}
86
86
  fill="none"
87
87
  height="21"
88
88
  role="img"