@brightlocal/ui-components 0.1.3 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. package/README.md +2 -1
  2. package/dist/accordion.cjs +1 -1
  3. package/dist/accordion.js +1 -1
  4. package/dist/alert.cjs +1 -1
  5. package/dist/alert.js +1 -1
  6. package/dist/blocks/data-table.cjs +1 -1
  7. package/dist/blocks/data-table.js +1 -1
  8. package/dist/blocks/sidebar.cjs +1 -1
  9. package/dist/blocks/sidebar.d.ts +37 -306
  10. package/dist/blocks/sidebar.d.ts.map +1 -1
  11. package/dist/blocks/sidebar.js +392 -489
  12. package/dist/breadcrumb.cjs +1 -1
  13. package/dist/breadcrumb.js +1 -1
  14. package/dist/button.cjs +1 -1
  15. package/dist/button.js +1 -1
  16. package/dist/calendar.cjs +1 -1
  17. package/dist/calendar.d.ts +4 -1
  18. package/dist/calendar.d.ts.map +1 -1
  19. package/dist/calendar.js +33 -33
  20. package/dist/centred-layout.cjs +1 -1
  21. package/dist/centred-layout.d.ts +5 -18
  22. package/dist/centred-layout.d.ts.map +1 -1
  23. package/dist/centred-layout.js +21 -23
  24. package/dist/checkbox.cjs +1 -1
  25. package/dist/checkbox.d.ts.map +1 -1
  26. package/dist/checkbox.js +19 -19
  27. package/dist/combobox.cjs +1 -1
  28. package/dist/combobox.d.ts +75 -67
  29. package/dist/combobox.d.ts.map +1 -1
  30. package/dist/combobox.js +241 -194
  31. package/dist/command.cjs +1 -1
  32. package/dist/command.js +1 -1
  33. package/dist/context-menu.cjs +1 -1
  34. package/dist/context-menu.js +1 -1
  35. package/dist/date-picker.cjs +1 -1
  36. package/dist/date-picker.js +1 -1
  37. package/dist/dialog.cjs +1 -1
  38. package/dist/dialog.js +1 -1
  39. package/dist/dropdown-menu.cjs +1 -1
  40. package/dist/dropdown-menu.js +1 -1
  41. package/dist/field.cjs +1 -1
  42. package/dist/field.d.ts +3 -0
  43. package/dist/field.d.ts.map +1 -1
  44. package/dist/field.js +5 -4
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.js +361 -366
  47. package/dist/input-group.cjs +1 -1
  48. package/dist/input-group.d.ts +5 -0
  49. package/dist/input-group.d.ts.map +1 -1
  50. package/dist/input-group.js +47 -39
  51. package/dist/input-otp.cjs +1 -1
  52. package/dist/input-otp.d.ts +6 -0
  53. package/dist/input-otp.d.ts.map +1 -1
  54. package/dist/input-otp.js +79 -76
  55. package/dist/input-password.cjs +1 -1
  56. package/dist/input-password.d.ts +4 -0
  57. package/dist/input-password.d.ts.map +1 -1
  58. package/dist/input-password.js +32 -31
  59. package/dist/input.cjs +1 -1
  60. package/dist/input.d.ts +4 -0
  61. package/dist/input.d.ts.map +1 -1
  62. package/dist/input.js +26 -24
  63. package/dist/link.cjs +1 -1
  64. package/dist/link.js +1 -1
  65. package/dist/logo.cjs +1 -1
  66. package/dist/logo.d.ts +6 -4
  67. package/dist/logo.d.ts.map +1 -1
  68. package/dist/logo.js +17 -20
  69. package/dist/menubar.cjs +1 -1
  70. package/dist/menubar.d.ts +3 -0
  71. package/dist/menubar.d.ts.map +1 -1
  72. package/dist/menubar.js +31 -30
  73. package/dist/navigation-menu.cjs +1 -1
  74. package/dist/navigation-menu.d.ts +6 -54
  75. package/dist/navigation-menu.d.ts.map +1 -1
  76. package/dist/navigation-menu.js +73 -84
  77. package/dist/pagination.cjs +1 -1
  78. package/dist/pagination.d.ts +8 -10
  79. package/dist/pagination.d.ts.map +1 -1
  80. package/dist/pagination.js +78 -86
  81. package/dist/radio-group.cjs +1 -1
  82. package/dist/radio-group.d.ts +10 -23
  83. package/dist/radio-group.d.ts.map +1 -1
  84. package/dist/radio-group.js +47 -55
  85. package/dist/resizable.cjs +1 -1
  86. package/dist/resizable.d.ts +19 -28
  87. package/dist/resizable.d.ts.map +1 -1
  88. package/dist/resizable.js +24 -40
  89. package/dist/select.cjs +1 -1
  90. package/dist/select.d.ts +3 -1
  91. package/dist/select.d.ts.map +1 -1
  92. package/dist/select.js +57 -56
  93. package/dist/separator.cjs +1 -1
  94. package/dist/separator.d.ts +4 -4
  95. package/dist/separator.d.ts.map +1 -1
  96. package/dist/separator.js +19 -21
  97. package/dist/sheet.cjs +1 -1
  98. package/dist/sheet.d.ts +5 -10
  99. package/dist/sheet.d.ts.map +1 -1
  100. package/dist/sheet.js +24 -26
  101. package/dist/sonner.cjs +1 -1
  102. package/dist/sonner.d.ts +17 -20
  103. package/dist/sonner.d.ts.map +1 -1
  104. package/dist/sonner.js +42 -45
  105. package/dist/switch.cjs +1 -1
  106. package/dist/switch.d.ts +2 -12
  107. package/dist/switch.d.ts.map +1 -1
  108. package/dist/switch.js +37 -41
  109. package/dist/table.cjs +1 -1
  110. package/dist/table.d.ts +16 -12
  111. package/dist/table.d.ts.map +1 -1
  112. package/dist/table.js +56 -58
  113. package/dist/tabs.d.ts +27 -3
  114. package/dist/tabs.d.ts.map +1 -1
  115. package/dist/textarea.cjs +1 -1
  116. package/dist/textarea.d.ts +4 -0
  117. package/dist/textarea.d.ts.map +1 -1
  118. package/dist/textarea.js +19 -18
  119. package/dist/toggle-group.cjs +1 -1
  120. package/dist/toggle-group.d.ts +57 -7
  121. package/dist/toggle-group.d.ts.map +1 -1
  122. package/dist/toggle-group.js +60 -67
  123. package/dist/toggle.cjs +1 -1
  124. package/dist/toggle.d.ts +12 -26
  125. package/dist/toggle.d.ts.map +1 -1
  126. package/dist/toggle.js +18 -22
  127. package/package.json +2 -2
  128. package/src/blocks/data-table.tsx +1 -1
  129. package/src/blocks/sidebar.tsx +157 -532
  130. package/src/components/accordion.tsx +1 -1
  131. package/src/components/alert.tsx +1 -1
  132. package/src/components/breadcrumb.tsx +1 -1
  133. package/src/components/button.tsx +1 -1
  134. package/src/components/calendar.tsx +6 -4
  135. package/src/components/centred-layout.tsx +11 -24
  136. package/src/components/checkbox.tsx +5 -6
  137. package/src/components/combobox.tsx +481 -301
  138. package/src/components/command.tsx +1 -1
  139. package/src/components/context-menu.tsx +1 -1
  140. package/src/components/date-picker.tsx +1 -1
  141. package/src/components/dialog.tsx +1 -1
  142. package/src/components/dropdown-menu.tsx +1 -1
  143. package/src/components/field.tsx +2 -0
  144. package/src/components/input-group.tsx +14 -2
  145. package/src/components/input-otp.tsx +17 -2
  146. package/src/components/input-password.tsx +7 -2
  147. package/src/components/input.tsx +11 -3
  148. package/src/components/link.tsx +1 -1
  149. package/src/components/logo.tsx +10 -8
  150. package/src/components/menubar.tsx +3 -1
  151. package/src/components/navigation-menu.tsx +37 -99
  152. package/src/components/pagination.tsx +13 -19
  153. package/src/components/radio-group.tsx +28 -38
  154. package/src/components/resizable.tsx +5 -43
  155. package/src/components/select.tsx +8 -3
  156. package/src/components/separator.tsx +5 -5
  157. package/src/components/sheet.tsx +6 -11
  158. package/src/components/sonner.tsx +24 -27
  159. package/src/components/switch.figma.tsx +7 -11
  160. package/src/components/switch.tsx +9 -19
  161. package/src/components/table.tsx +23 -18
  162. package/src/components/tabs.tsx +27 -3
  163. package/src/components/textarea.tsx +12 -5
  164. package/src/components/toggle-group.tsx +115 -86
  165. package/src/components/toggle.figma.tsx +13 -19
  166. package/src/components/toggle.tsx +32 -48
package/dist/menubar.js CHANGED
@@ -1,12 +1,12 @@
1
1
  import { jsx as o, jsxs as c } from "react/jsx-runtime";
2
2
  import * as r from "@radix-ui/react-menubar";
3
- import { Check as m, Circle as f, ChevronRight as b } from "lucide-react";
3
+ import { Check as m, Circle as f, ChevronRight as b } from "@brightlocal/icons";
4
4
  import { cn as s } from "@brightlocal/ui-components/lib/utils";
5
- function h({
5
+ function p({
6
6
  className: e,
7
7
  dataHook: t,
8
- defaultValue: n,
9
- ...a
8
+ defaultValue: a,
9
+ ...n
10
10
  }) {
11
11
  return /* @__PURE__ */ o(
12
12
  r.Root,
@@ -19,11 +19,12 @@ function h({
19
19
  "data-slot": "menubar",
20
20
  "data-tracking-el": "menubar",
21
21
  "data-tracking-label": t,
22
- defaultValue: n,
23
- ...a
22
+ defaultValue: a,
23
+ ...n
24
24
  }
25
25
  );
26
26
  }
27
+ p.displayName = "Menubar";
27
28
  function v({
28
29
  value: e,
29
30
  ...t
@@ -53,8 +54,8 @@ function y({
53
54
  function M({
54
55
  align: e = "start",
55
56
  alignOffset: t = -4,
56
- className: n,
57
- sideOffset: a = 8,
57
+ className: a,
58
+ sideOffset: n = 8,
58
59
  ...d
59
60
  }) {
60
61
  return /* @__PURE__ */ o(r.Portal, { children: /* @__PURE__ */ o(
@@ -66,10 +67,10 @@ function M({
66
67
  "border-border bg-popover text-popover-foreground z-50 min-w-[12rem] origin-(--radix-menubar-content-transform-origin) rounded-md border p-1 shadow-md",
67
68
  "data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
68
69
  "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",
69
- n
70
+ a
70
71
  ),
71
72
  "data-slot": "menubar-content",
72
- sideOffset: a,
73
+ sideOffset: n,
73
74
  ...d
74
75
  }
75
76
  ) });
@@ -77,8 +78,8 @@ function M({
77
78
  function N({
78
79
  className: e,
79
80
  disabled: t,
80
- inset: n,
81
- ...a
81
+ inset: a,
82
+ ...n
82
83
  }) {
83
84
  return /* @__PURE__ */ o(
84
85
  r.Item,
@@ -88,20 +89,20 @@ function N({
88
89
  "hover:bg-accent hover:text-foreground",
89
90
  "focus:bg-accent focus:text-foreground",
90
91
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
91
- n && "pl-8",
92
+ a && "pl-8",
92
93
  e
93
94
  ),
94
95
  "data-slot": "menubar-item",
95
96
  disabled: t,
96
- ...a
97
+ ...n
97
98
  }
98
99
  );
99
100
  }
100
101
  function z({
101
102
  checked: e,
102
103
  children: t,
103
- className: n,
104
- closeOnSelect: a = !0,
104
+ className: a,
105
+ closeOnSelect: n = !0,
105
106
  onCheckedChange: d,
106
107
  onSelect: u,
107
108
  ...i
@@ -115,12 +116,12 @@ function z({
115
116
  "hover:bg-accent hover:text-foreground",
116
117
  "focus:bg-accent focus:text-foreground",
117
118
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
118
- n
119
+ a
119
120
  ),
120
121
  "data-slot": "menubar-checkbox-item",
121
122
  onCheckedChange: d,
122
123
  onSelect: (l) => {
123
- a || l.preventDefault(), u?.(l);
124
+ n || l.preventDefault(), u?.(l);
124
125
  },
125
126
  ...i,
126
127
  children: [
@@ -133,7 +134,7 @@ function z({
133
134
  function S({
134
135
  onValueChange: e,
135
136
  value: t,
136
- ...n
137
+ ...a
137
138
  }) {
138
139
  return /* @__PURE__ */ o(
139
140
  r.RadioGroup,
@@ -141,15 +142,15 @@ function S({
141
142
  "data-slot": "menubar-radio-group",
142
143
  value: t,
143
144
  onValueChange: e,
144
- ...n
145
+ ...a
145
146
  }
146
147
  );
147
148
  }
148
149
  function w({
149
150
  children: e,
150
151
  className: t,
151
- closeOnSelect: n = !0,
152
- onSelect: a,
152
+ closeOnSelect: a = !0,
153
+ onSelect: n,
153
154
  value: d,
154
155
  ...u
155
156
  }) {
@@ -166,7 +167,7 @@ function w({
166
167
  "data-slot": "menubar-radio-item",
167
168
  value: d,
168
169
  onSelect: (i) => {
169
- n || i.preventDefault(), a?.(i);
170
+ a || i.preventDefault(), n?.(i);
170
171
  },
171
172
  ...u,
172
173
  children: [
@@ -179,7 +180,7 @@ function w({
179
180
  function I({
180
181
  className: e,
181
182
  inset: t,
182
- ...n
183
+ ...a
183
184
  }) {
184
185
  return /* @__PURE__ */ o(
185
186
  r.Label,
@@ -190,7 +191,7 @@ function I({
190
191
  e
191
192
  ),
192
193
  "data-slot": "menubar-label",
193
- ...n
194
+ ...a
194
195
  }
195
196
  );
196
197
  }
@@ -231,8 +232,8 @@ function k({
231
232
  function R({
232
233
  children: e,
233
234
  className: t,
234
- inset: n,
235
- ...a
235
+ inset: a,
236
+ ...n
236
237
  }) {
237
238
  return /* @__PURE__ */ c(
238
239
  r.SubTrigger,
@@ -243,11 +244,11 @@ function R({
243
244
  "focus:bg-accent focus:text-foreground",
244
245
  "data-[state=open]:bg-accent data-[state=open]:text-foreground",
245
246
  "data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
246
- n && "pl-8",
247
+ a && "pl-8",
247
248
  t
248
249
  ),
249
250
  "data-slot": "menubar-sub-trigger",
250
- ...a,
251
+ ...n,
251
252
  children: [
252
253
  e,
253
254
  /* @__PURE__ */ o(b, { className: "ml-auto size-4" })
@@ -274,7 +275,7 @@ function T({
274
275
  );
275
276
  }
276
277
  export {
277
- h as Menubar,
278
+ p as Menubar,
278
279
  z as MenubarCheckboxItem,
279
280
  M as MenubarContent,
280
281
  N as MenubarItem,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),h=require("react"),w=require("@radix-ui/react-navigation-menu"),M=require("lucide-react"),o=require("@brightlocal/ui-components/lib/utils");function u(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const a in t)if(a!=="default"){const i=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(e,a,i.get?i:{enumerable:!0,get:()=>t[a]})}}return e.default=t,Object.freeze(e)}const r=u(h),s=u(w),g=r.forwardRef(({className:t,children:e,dataHook:a,...i},d)=>n.jsxs(s.Root,{ref:d,className:o.cn("relative z-10 flex max-w-max flex-1 items-center justify-center",t),"data-hook":a,"data-slot":"navigation-menu",...i,children:[e,n.jsx(l,{})]}));g.displayName="NavigationMenu";const m=r.forwardRef(({className:t,...e},a)=>n.jsx(s.List,{ref:a,className:o.cn("group flex flex-1 list-none items-center justify-center gap-1",t),"data-slot":"navigation-menu-list",...e}));m.displayName="NavigationMenuList";const f=r.forwardRef((t,e)=>n.jsx(s.Item,{ref:e,"data-slot":"navigation-menu-item",...t}));f.displayName="NavigationMenuItem";const v=r.forwardRef(({className:t,children:e,dataHook:a,trackingEl:i,trackingLabel:d,...c},x)=>n.jsxs(s.Trigger,{ref:x,className:o.cn(["group inline-flex h-9 w-max items-center justify-center gap-1","rounded-md px-4 py-2","text-sm font-medium","text-foreground","transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=open]:bg-accent/50"],t),"data-hook":a,"data-slot":"navigation-menu-trigger","data-tracking-el":i||"navigation-menu-trigger","data-tracking-label":d,...c,children:[e,n.jsx(M.ChevronDown,{"aria-hidden":"true",className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"})]}));v.displayName="NavigationMenuTrigger";const p=r.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:i,...d},c)=>n.jsx(s.Content,{ref:c,className:o.cn(["data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out top-0 left-0 w-full","data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52","data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52","md:absolute md:w-auto"],t),"data-hook":e,"data-slot":"navigation-menu-content","data-tracking-el":a||"navigation-menu-content","data-tracking-label":i,...d}));p.displayName="NavigationMenuContent";const N=r.forwardRef(({className:t,dataHook:e,trackingEl:a,trackingLabel:i,...d},c)=>n.jsx(s.Link,{ref:c,className:o.cn(["block rounded-md p-3 leading-none no-underline select-none","transition-colors outline-none","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none"],t),"data-hook":e,"data-slot":"navigation-menu-link","data-tracking-el":a||"navigation-menu-link","data-tracking-label":i,...d}));N.displayName="NavigationMenuLink";const l=r.forwardRef(({className:t,...e},a)=>n.jsx("div",{className:o.cn("absolute top-full left-0 z-50 flex justify-center"),children:n.jsx(s.Viewport,{ref:a,className:o.cn(["origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)]","bg-popover text-popover-foreground w-full overflow-hidden rounded-md border shadow-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90","md:w-[var(--radix-navigation-menu-viewport-width)]"],t),"data-slot":"navigation-menu-viewport",...e})}));l.displayName="NavigationMenuViewport";const b=r.forwardRef(({className:t,...e},a)=>n.jsx(s.Indicator,{ref:a,className:o.cn(["top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out","data-[state=hidden]:fade-out data-[state=visible]:fade-in"],t),"data-slot":"navigation-menu-indicator",...e,children:n.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})}));b.displayName="NavigationMenuIndicator";exports.NavigationMenu=g;exports.NavigationMenuContent=p;exports.NavigationMenuIndicator=b;exports.NavigationMenuItem=f;exports.NavigationMenuLink=N;exports.NavigationMenuList=m;exports.NavigationMenuTrigger=v;exports.NavigationMenuViewport=l;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),b=require("react"),x=require("@radix-ui/react-navigation-menu"),w=require("@brightlocal/icons"),i=require("@brightlocal/ui-components/lib/utils");function c(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const a in e)if(a!=="default"){const r=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(t,a,r.get?r:{enumerable:!0,get:()=>e[a]})}}return t.default=e,Object.freeze(t)}const o=c(b),s=c(x),u=o.forwardRef(({className:e,children:t,dataHook:a,...r},N)=>n.jsxs(s.Root,{ref:N,className:i.cn("relative z-10 flex max-w-max flex-1 items-center justify-center",e),"data-hook":a,"data-slot":"navigation-menu",...r,children:[t,n.jsx(d,{})]}));u.displayName="NavigationMenu";const l=o.forwardRef(({className:e,...t},a)=>n.jsx(s.List,{ref:a,className:i.cn("group flex flex-1 list-none items-center justify-center gap-1",e),"data-slot":"navigation-menu-list",...t}));l.displayName="NavigationMenuList";const g=o.forwardRef((e,t)=>n.jsx(s.Item,{ref:t,"data-slot":"navigation-menu-item",...e}));g.displayName="NavigationMenuItem";const m=o.forwardRef(({className:e,children:t,...a},r)=>n.jsxs(s.Trigger,{ref:r,className:i.cn(["group inline-flex h-9 w-max items-center justify-center gap-1","rounded-md px-4 py-2","text-sm font-medium","text-foreground","transition-colors","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none","disabled:pointer-events-none disabled:opacity-50","data-[state=open]:bg-accent/50"],e),"data-slot":"navigation-menu-trigger",...a,children:[t,n.jsx(w.ChevronDown,{"aria-hidden":"true",className:"relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"})]}));m.displayName="NavigationMenuTrigger";const f=o.forwardRef(({className:e,...t},a)=>n.jsx(s.Content,{ref:a,className:i.cn(["data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out top-0 left-0 w-full","data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out","data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52","data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52","md:absolute md:w-auto"],e),"data-slot":"navigation-menu-content",...t}));f.displayName="NavigationMenuContent";const v=o.forwardRef(({className:e,...t},a)=>n.jsx(s.Link,{ref:a,className:i.cn(["block rounded-md p-3 leading-none no-underline select-none","transition-colors outline-none","hover:bg-accent hover:text-accent-foreground","focus:bg-accent focus:text-accent-foreground","focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none"],e),"data-slot":"navigation-menu-link",...t}));v.displayName="NavigationMenuLink";const d=o.forwardRef(({className:e,...t},a)=>n.jsx("div",{className:i.cn("absolute top-full left-0 z-50 flex justify-center"),children:n.jsx(s.Viewport,{ref:a,className:i.cn(["origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)]","bg-popover text-popover-foreground w-full overflow-hidden rounded-md border shadow-sm","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90","md:w-[var(--radix-navigation-menu-viewport-width)]"],e),"data-slot":"navigation-menu-viewport",...t})}));d.displayName="NavigationMenuViewport";const p=o.forwardRef(({className:e,...t},a)=>n.jsx(s.Indicator,{ref:a,className:i.cn(["top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden","data-[state=visible]:animate-in data-[state=hidden]:animate-out","data-[state=hidden]:fade-out data-[state=visible]:fade-in"],e),"data-slot":"navigation-menu-indicator",...t,children:n.jsx("div",{className:"bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md"})}));p.displayName="NavigationMenuIndicator";exports.NavigationMenu=u;exports.NavigationMenuContent=f;exports.NavigationMenuIndicator=p;exports.NavigationMenuItem=g;exports.NavigationMenuLink=v;exports.NavigationMenuList=l;exports.NavigationMenuTrigger=m;exports.NavigationMenuViewport=d;
@@ -21,78 +21,30 @@ declare const NavigationMenuItem: React.ForwardRefExoticComponent<Omit<Navigatio
21
21
  /**
22
22
  * Props for NavigationMenuTrigger component
23
23
  */
24
- interface NavigationMenuTriggerProps extends React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger> {
25
- /**
26
- * Data hook for automated testing (REQUIRED)
27
- * Used to identify component in tests and E2E automation
28
- */
29
- dataHook: string;
30
- /**
31
- * Tracking element identifier for analytics
32
- * Defaults to component name if not provided
33
- */
34
- trackingEl?: string;
35
- /**
36
- * Tracking label for analytics context
37
- * Additional context for tracking events
38
- */
39
- trackingLabel?: string;
40
- }
24
+ type NavigationMenuTriggerProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>;
41
25
  /**
42
26
  * Trigger button that opens a dropdown menu
43
27
  * Includes chevron icon that rotates when open
44
28
  */
45
- declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
29
+ declare const NavigationMenuTrigger: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
46
30
  /**
47
31
  * Props for NavigationMenuContent component
48
32
  */
49
- interface NavigationMenuContentProps extends React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content> {
50
- /**
51
- * Data hook for automated testing (REQUIRED)
52
- * Used to identify component in tests and E2E automation
53
- */
54
- dataHook: string;
55
- /**
56
- * Tracking element identifier for analytics
57
- * Defaults to component name if not provided
58
- */
59
- trackingEl?: string;
60
- /**
61
- * Tracking label for analytics context
62
- * Additional context for tracking events
63
- */
64
- trackingLabel?: string;
65
- }
33
+ type NavigationMenuContentProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>;
66
34
  /**
67
35
  * Dropdown content container
68
36
  * Appears below the trigger when open
69
37
  */
70
- declare const NavigationMenuContent: React.ForwardRefExoticComponent<NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>>;
38
+ declare const NavigationMenuContent: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
71
39
  /**
72
40
  * Props for NavigationMenuLink component
73
41
  */
74
- interface NavigationMenuLinkProps extends React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link> {
75
- /**
76
- * Data hook for automated testing (REQUIRED)
77
- * Used to identify component in tests and E2E automation
78
- */
79
- dataHook: string;
80
- /**
81
- * Tracking element identifier for analytics
82
- * Defaults to component name if not provided
83
- */
84
- trackingEl?: string;
85
- /**
86
- * Tracking label for analytics context
87
- * Additional context for tracking events
88
- */
89
- trackingLabel?: string;
90
- }
42
+ type NavigationMenuLinkProps = React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Link>;
91
43
  /**
92
44
  * Navigation link within the menu
93
45
  * Can be used as a trigger child or within content
94
46
  */
95
- declare const NavigationMenuLink: React.ForwardRefExoticComponent<NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>>;
47
+ declare const NavigationMenuLink: React.ForwardRefExoticComponent<Omit<NavigationMenuPrimitive.NavigationMenuLinkProps & React.RefAttributes<HTMLAnchorElement>, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
96
48
  /**
97
49
  * Viewport container for navigation menu content
98
50
  * Positions and animates the dropdown content
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,uBAAuB,MAAM,iCAAiC,CAAC;AAK3E;;;GAGG;AACH,UAAU,mBAAoB,SAAQ,KAAK,CAAC,wBAAwB,CAClE,OAAO,uBAAuB,CAAC,IAAI,CACpC;IACC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,QAAA,MAAM,cAAc,yFAiBlB,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,kBAAkB,+KAatB,CAAC;AAIH;;GAEG;AACH,QAAA,MAAM,kBAAkB,yKAStB,CAAC;AAIH;;GAEG;AACH,UAAU,0BAA2B,SAAQ,KAAK,CAAC,wBAAwB,CACzE,OAAO,uBAAuB,CAAC,OAAO,CACvC;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,qBAAqB,sGAsC1B,CAAC;AAIF;;GAEG;AACH,UAAU,0BAA2B,SAAQ,KAAK,CAAC,wBAAwB,CACzE,OAAO,uBAAuB,CAAC,OAAO,CACvC;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,qBAAqB,mGAsBzB,CAAC;AAIH;;GAEG;AACH,UAAU,uBAAwB,SAAQ,KAAK,CAAC,wBAAwB,CACtE,OAAO,uBAAuB,CAAC,IAAI,CACpC;IACC;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;GAGG;AACH,QAAA,MAAM,kBAAkB,mGAsBtB,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,sBAAsB,+KAqB1B,CAAC;AAIH;;;GAGG;AACH,QAAA,MAAM,uBAAuB,gLAmB3B,CAAC;AAIH,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,kBAAkB,EAClB,sBAAsB,EACtB,uBAAuB,GACxB,CAAC;AAEF,YAAY,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,uBAAuB,GACxB,CAAC"}
1
+ {"version":3,"file":"navigation-menu.d.ts","sourceRoot":"","sources":["../../src/components/navigation-menu.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,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time";
2
2
  import * as n from "react";
3
3
  import * as r from "@radix-ui/react-navigation-menu";
4
- import { ChevronDown as g } from "lucide-react";
4
+ import { ChevronDown as c } from "@brightlocal/icons";
5
5
  import { cn as i } from "@brightlocal/ui-components/lib/utils";
6
- const f = n.forwardRef(({ className: t, children: a, dataHook: e, ...s }, d) => /* @__PURE__ */ m(
6
+ const u = n.forwardRef(({ className: t, children: e, dataHook: a, ...s }, m) => /* @__PURE__ */ d(
7
7
  r.Root,
8
8
  {
9
- ref: d,
9
+ ref: m,
10
10
  className: i(
11
11
  "relative z-10 flex max-w-max flex-1 items-center justify-center",
12
12
  t
13
13
  ),
14
- "data-hook": e,
14
+ "data-hook": a,
15
15
  "data-slot": "navigation-menu",
16
16
  ...s,
17
17
  children: [
18
- a,
19
- /* @__PURE__ */ o(c, {})
18
+ e,
19
+ /* @__PURE__ */ o(l, {})
20
20
  ]
21
21
  }
22
22
  ));
23
- f.displayName = "NavigationMenu";
24
- const v = n.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ o(
23
+ u.displayName = "NavigationMenu";
24
+ const f = n.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
25
25
  r.List,
26
26
  {
27
- ref: e,
27
+ ref: a,
28
28
  className: i(
29
29
  "group flex flex-1 list-none items-center justify-center gap-1",
30
30
  t
31
31
  ),
32
32
  "data-slot": "navigation-menu-list",
33
- ...a
33
+ ...e
34
34
  }
35
35
  ));
36
- v.displayName = "NavigationMenuList";
37
- const p = n.forwardRef((t, a) => /* @__PURE__ */ o(
36
+ f.displayName = "NavigationMenuList";
37
+ const g = n.forwardRef((t, e) => /* @__PURE__ */ o(
38
38
  r.Item,
39
39
  {
40
- ref: a,
40
+ ref: e,
41
41
  "data-slot": "navigation-menu-item",
42
42
  ...t
43
43
  }
44
44
  ));
45
- p.displayName = "NavigationMenuItem";
46
- const N = n.forwardRef(
47
- ({ className: t, children: a, dataHook: e, trackingEl: s, trackingLabel: d, ...l }, u) => /* @__PURE__ */ m(
48
- r.Trigger,
49
- {
50
- ref: u,
51
- className: i(
52
- [
53
- "group inline-flex h-9 w-max items-center justify-center gap-1",
54
- "rounded-md px-4 py-2",
55
- "text-sm font-medium",
56
- "text-foreground",
57
- "transition-colors",
58
- "hover:bg-accent hover:text-accent-foreground",
59
- "focus:bg-accent focus:text-accent-foreground",
60
- "focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none",
61
- "disabled:pointer-events-none disabled:opacity-50",
62
- "data-[state=open]:bg-accent/50"
63
- ],
64
- t
65
- ),
66
- "data-hook": e,
67
- "data-slot": "navigation-menu-trigger",
68
- "data-tracking-el": s || "navigation-menu-trigger",
69
- "data-tracking-label": d,
70
- ...l,
71
- children: [
72
- a,
73
- /* @__PURE__ */ o(
74
- g,
75
- {
76
- "aria-hidden": "true",
77
- className: "relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
78
- }
79
- )
80
- ]
81
- }
82
- )
83
- );
84
- N.displayName = "NavigationMenuTrigger";
85
- const b = n.forwardRef(({ className: t, dataHook: a, trackingEl: e, trackingLabel: s, ...d }, l) => /* @__PURE__ */ o(
45
+ g.displayName = "NavigationMenuItem";
46
+ const v = n.forwardRef(({ className: t, children: e, ...a }, s) => /* @__PURE__ */ d(
47
+ r.Trigger,
48
+ {
49
+ ref: s,
50
+ className: i(
51
+ [
52
+ "group inline-flex h-9 w-max items-center justify-center gap-1",
53
+ "rounded-md px-4 py-2",
54
+ "text-sm font-medium",
55
+ "text-foreground",
56
+ "transition-colors",
57
+ "hover:bg-accent hover:text-accent-foreground",
58
+ "focus:bg-accent focus:text-accent-foreground",
59
+ "focus-visible:bg-accent focus-visible:ring-ring focus-visible:shadow-[0_0_0_4px_rgba(163,163,163,0.1)] focus-visible:ring-1 focus-visible:outline-none",
60
+ "disabled:pointer-events-none disabled:opacity-50",
61
+ "data-[state=open]:bg-accent/50"
62
+ ],
63
+ t
64
+ ),
65
+ "data-slot": "navigation-menu-trigger",
66
+ ...a,
67
+ children: [
68
+ e,
69
+ /* @__PURE__ */ o(
70
+ c,
71
+ {
72
+ "aria-hidden": "true",
73
+ className: "relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
74
+ }
75
+ )
76
+ ]
77
+ }
78
+ ));
79
+ v.displayName = "NavigationMenuTrigger";
80
+ const p = n.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
86
81
  r.Content,
87
82
  {
88
- ref: l,
83
+ ref: a,
89
84
  className: i(
90
85
  [
91
86
  "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out top-0 left-0 w-full",
@@ -96,18 +91,15 @@ const b = n.forwardRef(({ className: t, dataHook: a, trackingEl: e, trackingLabe
96
91
  ],
97
92
  t
98
93
  ),
99
- "data-hook": a,
100
94
  "data-slot": "navigation-menu-content",
101
- "data-tracking-el": e || "navigation-menu-content",
102
- "data-tracking-label": s,
103
- ...d
95
+ ...e
104
96
  }
105
97
  ));
106
- b.displayName = "NavigationMenuContent";
107
- const h = n.forwardRef(({ className: t, dataHook: a, trackingEl: e, trackingLabel: s, ...d }, l) => /* @__PURE__ */ o(
98
+ p.displayName = "NavigationMenuContent";
99
+ const N = n.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
108
100
  r.Link,
109
101
  {
110
- ref: l,
102
+ ref: a,
111
103
  className: i(
112
104
  [
113
105
  "block rounded-md p-3 leading-none no-underline select-none",
@@ -118,18 +110,15 @@ const h = n.forwardRef(({ className: t, dataHook: a, trackingEl: e, trackingLabe
118
110
  ],
119
111
  t
120
112
  ),
121
- "data-hook": a,
122
113
  "data-slot": "navigation-menu-link",
123
- "data-tracking-el": e || "navigation-menu-link",
124
- "data-tracking-label": s,
125
- ...d
114
+ ...e
126
115
  }
127
116
  ));
128
- h.displayName = "NavigationMenuLink";
129
- const c = n.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ o("div", { className: i("absolute top-full left-0 z-50 flex justify-center"), children: /* @__PURE__ */ o(
117
+ N.displayName = "NavigationMenuLink";
118
+ const l = n.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o("div", { className: i("absolute top-full left-0 z-50 flex justify-center"), children: /* @__PURE__ */ o(
130
119
  r.Viewport,
131
120
  {
132
- ref: e,
121
+ ref: a,
133
122
  className: i(
134
123
  [
135
124
  "origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)]",
@@ -141,14 +130,14 @@ const c = n.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ o("div", {
141
130
  t
142
131
  ),
143
132
  "data-slot": "navigation-menu-viewport",
144
- ...a
133
+ ...e
145
134
  }
146
135
  ) }));
147
- c.displayName = "NavigationMenuViewport";
148
- const w = n.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ o(
136
+ l.displayName = "NavigationMenuViewport";
137
+ const b = n.forwardRef(({ className: t, ...e }, a) => /* @__PURE__ */ o(
149
138
  r.Indicator,
150
139
  {
151
- ref: e,
140
+ ref: a,
152
141
  className: i(
153
142
  [
154
143
  "top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
@@ -158,18 +147,18 @@ const w = n.forwardRef(({ className: t, ...a }, e) => /* @__PURE__ */ o(
158
147
  t
159
148
  ),
160
149
  "data-slot": "navigation-menu-indicator",
161
- ...a,
150
+ ...e,
162
151
  children: /* @__PURE__ */ o("div", { className: "bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" })
163
152
  }
164
153
  ));
165
- w.displayName = "NavigationMenuIndicator";
154
+ b.displayName = "NavigationMenuIndicator";
166
155
  export {
167
- f as NavigationMenu,
168
- b as NavigationMenuContent,
169
- w as NavigationMenuIndicator,
170
- p as NavigationMenuItem,
171
- h as NavigationMenuLink,
172
- v as NavigationMenuList,
173
- N as NavigationMenuTrigger,
174
- c as NavigationMenuViewport
156
+ u as NavigationMenu,
157
+ p as NavigationMenuContent,
158
+ b as NavigationMenuIndicator,
159
+ g as NavigationMenuItem,
160
+ N as NavigationMenuLink,
161
+ f as NavigationMenuList,
162
+ v as NavigationMenuTrigger,
163
+ l as NavigationMenuViewport
175
164
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),d=require("lucide-react"),N=require("class-variance-authority"),f=require("@brightlocal/ui-components/lib/utils");function k(e){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(i,n,a.get?a:{enumerable:!0,get:()=>e[n]})}}return i.default=e,Object.freeze(i)}const l=k(j);var g=(e=>(e.PREVIOUS="previous",e.NEXT="next",e.LINK="link",e.ELLIPSIS="ellipsis",e))(g||{});function I({page:e,totalPages:i,siblingCount:n=1,boundaryCount:a=1}){return l.useMemo(()=>{const r=[];r.push("previous");const u=Math.max(e-n,a+1),p=Math.min(e+n,i-a),b=u>a+2,P=p<i-a-1;for(let t=1;t<=Math.min(a,i);t++)r.push(t);if(b)r.push("ellipsis");else if(a+1<u)for(let t=a+1;t<u;t++)r.push(t);for(let t=u;t<=p;t++)t>a&&t<=i-a&&r.push(t);if(P)r.push("ellipsis");else if(p<i-a)for(let t=p+1;t<i-a+1;t++)r.push(t);for(let t=Math.max(i-a+1,a+1);t<=i;t++)t>a&&r.push(t);return r.push("next"),r},[e,i,n,a])}const v=N.cva(["inline-flex items-center justify-center","h-9 w-9","rounded-full","text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:shadow-default"],{variants:{variant:{previous:["text-foreground","hover:bg-accent","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],next:["text-foreground","hover:bg-accent","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],link:["text-foreground","hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-background aria-[current=page]:border aria-[current=page]:border-input","dark:aria-[current=page]:bg-input/30","aria-[current=page]:hover:bg-accent","aria-[current=page]:focus-visible:border-ring","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],ellipsis:["cursor-default","text-foreground","pointer-events-none"]}},defaultVariants:{variant:"link"}});function w({className:e,dataHook:i,trackingEl:n,trackingLabel:a,ariaLabel:o="Pagination",...r}){return s.jsx("nav",{"aria-label":o,className:f.cn("mx-auto flex w-full justify-center",e),"data-hook":i,"data-slot":"pagination","data-tracking-el":n||"pagination","data-tracking-label":a,role:"navigation",...r})}function R({className:e,...i}){return s.jsx("ul",{className:f.cn("flex flex-row items-center gap-2",e),"data-slot":"pagination-content",...i})}function M(e){return s.jsx("li",{"data-slot":"pagination-item",...e})}const c=l.forwardRef(({className:e,variant:i,isActive:n,children:a,...o},r)=>s.jsx("button",{ref:r,"aria-current":n?"page":void 0,className:f.cn(v({variant:i}),e),"data-active":n,"data-slot":"pagination-button",type:"button",...o,children:a}));c.displayName="PaginationButton";const x=l.forwardRef(({className:e,disabled:i,...n},a)=>s.jsx(c,{ref:a,"aria-disabled":i,"aria-label":"Go to previous page",className:e,disabled:i,variant:"previous",...n,children:s.jsx(d.ChevronLeftIcon,{className:"size-4"})}));x.displayName="PaginationPrevious";const h=l.forwardRef(({className:e,disabled:i,...n},a)=>s.jsx(c,{ref:a,"aria-disabled":i,"aria-label":"Go to next page",className:e,disabled:i,variant:"next",...n,children:s.jsx(d.ChevronRightIcon,{className:"size-4"})}));h.displayName="PaginationNext";const m=l.forwardRef(({className:e,page:i,isActive:n,...a},o)=>s.jsx(c,{ref:o,"aria-label":`Go to page ${i}`,className:e,isActive:n,variant:"link",...a,children:i}));m.displayName="PaginationLink";function S({className:e,...i}){return s.jsxs("span",{"aria-hidden":"true",className:f.cn(v({variant:"ellipsis"}),e),"data-slot":"pagination-ellipsis",...i,children:[s.jsx(d.MoreHorizontalIcon,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"More pages"})]})}exports.Pagination=w;exports.PaginationButton=c;exports.PaginationContent=R;exports.PaginationEllipsis=S;exports.PaginationItem=M;exports.PaginationLink=m;exports.PaginationNext=h;exports.PaginationPrevious=x;exports.PaginationVariant=g;exports.usePagination=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),j=require("react"),d=require("@brightlocal/icons"),N=require("class-variance-authority"),f=require("@brightlocal/ui-components/lib/utils");function k(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const n in a)if(n!=="default"){const i=Object.getOwnPropertyDescriptor(a,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:()=>a[n]})}}return e.default=a,Object.freeze(e)}const l=k(j);function w({page:a,totalPages:e,siblingCount:n=1,boundaryCount:i=1}){return l.useMemo(()=>{const r=[];r.push("previous");const u=Math.max(a-n,i+1),p=Math.min(a+n,e-i),b=u>i+2,P=p<e-i-1;for(let t=1;t<=Math.min(i,e);t++)r.push(t);if(b)r.push("ellipsis");else if(i+1<u)for(let t=i+1;t<u;t++)r.push(t);for(let t=u;t<=p;t++)t>i&&t<=e-i&&r.push(t);if(P)r.push("ellipsis");else if(p<e-i)for(let t=p+1;t<e-i+1;t++)r.push(t);for(let t=Math.max(e-i+1,i+1);t<=e;t++)t>i&&r.push(t);return r.push("next"),r},[a,e,n,i])}const g=N.cva(["inline-flex items-center justify-center","h-9 w-9","rounded-full","text-sm font-medium","transition-colors","focus-visible:outline-none focus-visible:shadow-default"],{variants:{variant:{previous:["text-foreground","hover:bg-accent","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],next:["text-foreground","hover:bg-accent","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],link:["text-foreground","hover:bg-accent hover:text-accent-foreground","aria-[current=page]:bg-background aria-[current=page]:border aria-[current=page]:border-input","dark:aria-[current=page]:bg-input/30","aria-[current=page]:hover:bg-accent","aria-[current=page]:focus-visible:border-ring","aria-disabled:opacity-50 aria-disabled:cursor-default aria-disabled:pointer-events-none"],ellipsis:["cursor-default","text-foreground","pointer-events-none"]}},defaultVariants:{variant:"link"}});function m({className:a,dataHook:e,trackingEl:n,trackingLabel:i,ariaLabel:o="Pagination",...r}){return s.jsx("nav",{"aria-label":o,className:f.cn("mx-auto flex w-full justify-center",a),"data-hook":e,"data-slot":"pagination","data-tracking-el":n||"pagination","data-tracking-label":i,role:"navigation",...r})}m.displayName="Pagination";function M({className:a,...e}){return s.jsx("ul",{className:f.cn("flex flex-row items-center gap-2",a),"data-slot":"pagination-content",...e})}function R(a){return s.jsx("li",{"data-slot":"pagination-item",...a})}const c=l.forwardRef(({className:a,variant:e,isActive:n,children:i,...o},r)=>s.jsx("button",{ref:r,"aria-current":n?"page":void 0,className:f.cn(g({variant:e}),a),"data-active":n,"data-slot":"pagination-button",type:"button",...o,children:i}));c.displayName="PaginationButton";const h=l.forwardRef(({className:a,disabled:e,...n},i)=>s.jsx(c,{ref:i,"aria-disabled":e,"aria-label":"Go to previous page",className:a,disabled:e,variant:"previous",...n,children:s.jsx(d.ChevronLeftIcon,{className:"size-4"})}));h.displayName="PaginationPrevious";const x=l.forwardRef(({className:a,disabled:e,...n},i)=>s.jsx(c,{ref:i,"aria-disabled":e,"aria-label":"Go to next page",className:a,disabled:e,variant:"next",...n,children:s.jsx(d.ChevronRightIcon,{className:"size-4"})}));x.displayName="PaginationNext";const v=l.forwardRef(({className:a,page:e,isActive:n,...i},o)=>s.jsx(c,{ref:o,"aria-label":`Go to page ${e}`,className:a,isActive:n,variant:"link",...i,children:e}));v.displayName="PaginationLink";function I({className:a,...e}){return s.jsxs("span",{"aria-hidden":"true",className:f.cn(g({variant:"ellipsis"}),a),"data-slot":"pagination-ellipsis",...e,children:[s.jsx(d.MoreHorizontalIcon,{className:"size-4"}),s.jsx("span",{className:"sr-only",children:"More pages"})]})}exports.Pagination=m;exports.PaginationButton=c;exports.PaginationContent=M;exports.PaginationEllipsis=I;exports.PaginationItem=R;exports.PaginationLink=v;exports.PaginationNext=x;exports.PaginationPrevious=h;exports.usePagination=w;
@@ -2,17 +2,12 @@ import { VariantProps } from 'class-variance-authority';
2
2
  import * as React from "react";
3
3
  /**
4
4
  * Pagination item variants
5
+ * - `previous`: Previous navigation button
6
+ * - `next`: Next navigation button
7
+ * - `link`: Page number link
8
+ * - `ellipsis`: Ellipsis indicator for skipped pages
5
9
  */
6
- export declare enum PaginationVariant {
7
- /** Previous navigation button */
8
- PREVIOUS = "previous",
9
- /** Next navigation button */
10
- NEXT = "next",
11
- /** Page number link */
12
- LINK = "link",
13
- /** Ellipsis indicator for skipped pages */
14
- ELLIPSIS = "ellipsis"
15
- }
10
+ export type PaginationVariant = "previous" | "next" | "link" | "ellipsis";
16
11
  /**
17
12
  * Pagination hook parameters
18
13
  */
@@ -53,6 +48,9 @@ interface PaginationProps extends React.ComponentProps<"nav"> {
53
48
  ariaLabel?: string;
54
49
  }
55
50
  declare function Pagination({ className, dataHook, trackingEl, trackingLabel, ariaLabel, ...props }: PaginationProps): import("react/jsx-runtime").JSX.Element;
51
+ declare namespace Pagination {
52
+ var displayName: string;
53
+ }
56
54
  declare function PaginationContent({ className, ...props }: React.ComponentProps<"ul">): import("react/jsx-runtime").JSX.Element;
57
55
  declare function PaginationItem(props: React.ComponentProps<"li">): import("react/jsx-runtime").JSX.Element;
58
56
  interface PaginationButtonProps extends Omit<React.ComponentProps<"button">, "variant">, VariantProps<typeof paginationItemVariants> {
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../../src/components/pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAGlE;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,iCAAiC;IACjC,QAAQ,aAAa;IACrB,6BAA6B;IAC7B,IAAI,SAAS;IACb,uBAAuB;IACvB,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