@brightlocal/ui-components 0.1.2 → 0.1.4

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 (281) hide show
  1. package/dist/accordion.cjs +1 -1
  2. package/dist/accordion.d.ts +74 -4
  3. package/dist/accordion.d.ts.map +1 -1
  4. package/dist/accordion.js +100 -105
  5. package/dist/alert-dialog.cjs +1 -1
  6. package/dist/alert-dialog.d.ts +30 -10
  7. package/dist/alert-dialog.d.ts.map +1 -1
  8. package/dist/alert-dialog.js +129 -132
  9. package/dist/alert.cjs +1 -1
  10. package/dist/alert.d.ts +22 -1
  11. package/dist/alert.d.ts.map +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/aspect-ratio.cjs +1 -1
  14. package/dist/aspect-ratio.d.ts +11 -1
  15. package/dist/aspect-ratio.d.ts.map +1 -1
  16. package/dist/aspect-ratio.js +16 -20
  17. package/dist/avatar.cjs +1 -1
  18. package/dist/avatar.d.ts +43 -3
  19. package/dist/avatar.d.ts.map +1 -1
  20. package/dist/avatar.js +18 -16
  21. package/dist/badge.cjs +1 -1
  22. package/dist/badge.d.ts +24 -9
  23. package/dist/badge.d.ts.map +1 -1
  24. package/dist/badge.js +34 -32
  25. package/dist/blocks/data-table.cjs +1 -1
  26. package/dist/blocks/data-table.d.ts.map +1 -1
  27. package/dist/blocks/data-table.js +177 -170
  28. package/dist/blocks/sidebar.cjs +1 -1
  29. package/dist/blocks/sidebar.d.ts +38 -307
  30. package/dist/blocks/sidebar.d.ts.map +1 -1
  31. package/dist/blocks/sidebar.js +411 -508
  32. package/dist/breadcrumb.cjs +1 -1
  33. package/dist/breadcrumb.d.ts +63 -8
  34. package/dist/breadcrumb.d.ts.map +1 -1
  35. package/dist/breadcrumb.js +97 -93
  36. package/dist/button.cjs +1 -1
  37. package/dist/button.d.ts +17 -45
  38. package/dist/button.d.ts.map +1 -1
  39. package/dist/button.js +49 -50
  40. package/dist/calendar.cjs +1 -1
  41. package/dist/calendar.d.ts +16 -1
  42. package/dist/calendar.d.ts.map +1 -1
  43. package/dist/calendar.js +31 -29
  44. package/dist/card.cjs +1 -1
  45. package/dist/card.d.ts +58 -18
  46. package/dist/card.d.ts.map +1 -1
  47. package/dist/card.js +60 -51
  48. package/dist/carousel.cjs +1 -1
  49. package/dist/carousel.d.ts +99 -9
  50. package/dist/carousel.d.ts.map +1 -1
  51. package/dist/carousel.js +142 -128
  52. package/dist/centred-layout.cjs +1 -1
  53. package/dist/centred-layout.d.ts +18 -15
  54. package/dist/centred-layout.d.ts.map +1 -1
  55. package/dist/centred-layout.js +44 -33
  56. package/dist/chart.cjs +4 -4
  57. package/dist/chart.d.ts +70 -7
  58. package/dist/chart.d.ts.map +1 -1
  59. package/dist/chart.js +71 -66
  60. package/dist/checkbox.cjs +1 -1
  61. package/dist/checkbox.d.ts +9 -5
  62. package/dist/checkbox.d.ts.map +1 -1
  63. package/dist/checkbox.js +61 -82
  64. package/dist/collapsible.cjs +1 -1
  65. package/dist/collapsible.d.ts +65 -8
  66. package/dist/collapsible.d.ts.map +1 -1
  67. package/dist/collapsible.js +41 -55
  68. package/dist/combobox.cjs +1 -1
  69. package/dist/combobox.d.ts +28 -18
  70. package/dist/combobox.d.ts.map +1 -1
  71. package/dist/combobox.js +191 -160
  72. package/dist/command.cjs +1 -1
  73. package/dist/command.d.ts +115 -9
  74. package/dist/command.d.ts.map +1 -1
  75. package/dist/command.js +176 -152
  76. package/dist/context-menu.cjs +1 -1
  77. package/dist/context-menu.d.ts +188 -20
  78. package/dist/context-menu.d.ts.map +1 -1
  79. package/dist/context-menu.js +120 -122
  80. package/dist/date-picker.cjs +1 -1
  81. package/dist/date-picker.d.ts +75 -9
  82. package/dist/date-picker.d.ts.map +1 -1
  83. package/dist/date-picker.js +221 -82
  84. package/dist/description.cjs +1 -0
  85. package/dist/description.d.ts +37 -0
  86. package/dist/description.d.ts.map +1 -0
  87. package/dist/description.js +25 -0
  88. package/dist/dialog.cjs +1 -1
  89. package/dist/dialog.d.ts +73 -9
  90. package/dist/dialog.d.ts.map +1 -1
  91. package/dist/dialog.js +103 -112
  92. package/dist/drawer.cjs +1 -1
  93. package/dist/drawer.d.ts +92 -0
  94. package/dist/drawer.d.ts.map +1 -1
  95. package/dist/drawer.js +67 -52
  96. package/dist/dropdown-menu.cjs +1 -1
  97. package/dist/dropdown-menu.d.ts +95 -11
  98. package/dist/dropdown-menu.d.ts.map +1 -1
  99. package/dist/dropdown-menu.js +146 -106
  100. package/dist/field.cjs +1 -1
  101. package/dist/field.d.ts +26 -6
  102. package/dist/field.d.ts.map +1 -1
  103. package/dist/field.js +55 -53
  104. package/dist/global-layout.cjs +1 -1
  105. package/dist/global-layout.d.ts +27 -17
  106. package/dist/global-layout.d.ts.map +1 -1
  107. package/dist/global-layout.js +86 -79
  108. package/dist/hover-card.cjs +1 -1
  109. package/dist/hover-card.d.ts +36 -6
  110. package/dist/hover-card.d.ts.map +1 -1
  111. package/dist/hover-card.js +44 -42
  112. package/dist/index.cjs +1 -1
  113. package/dist/index.d.ts +1 -1
  114. package/dist/index.d.ts.map +1 -1
  115. package/dist/index.js +367 -386
  116. package/dist/input-group.cjs +1 -1
  117. package/dist/input-group.d.ts +21 -2
  118. package/dist/input-group.d.ts.map +1 -1
  119. package/dist/input-group.js +51 -41
  120. package/dist/input-otp.cjs +1 -1
  121. package/dist/input-otp.js +1 -1
  122. package/dist/input-password.cjs +1 -1
  123. package/dist/input-password.d.ts.map +1 -1
  124. package/dist/input-password.js +25 -26
  125. package/dist/input.cjs +1 -1
  126. package/dist/input.d.ts +38 -24
  127. package/dist/input.d.ts.map +1 -1
  128. package/dist/input.js +68 -136
  129. package/dist/label.cjs +1 -1
  130. package/dist/label.d.ts +20 -1
  131. package/dist/label.d.ts.map +1 -1
  132. package/dist/label.js +31 -18
  133. package/dist/link.cjs +1 -1
  134. package/dist/link.js +1 -1
  135. package/dist/logo.cjs +1 -1
  136. package/dist/logo.d.ts +9 -4
  137. package/dist/logo.d.ts.map +1 -1
  138. package/dist/logo.js +20 -21
  139. package/dist/menubar.cjs +1 -1
  140. package/dist/menubar.d.ts +43 -6
  141. package/dist/menubar.d.ts.map +1 -1
  142. package/dist/menubar.js +100 -78
  143. package/dist/navigation-menu.cjs +1 -1
  144. package/dist/navigation-menu.d.ts +6 -54
  145. package/dist/navigation-menu.d.ts.map +1 -1
  146. package/dist/navigation-menu.js +73 -84
  147. package/dist/pagination.cjs +1 -1
  148. package/dist/pagination.d.ts +8 -10
  149. package/dist/pagination.d.ts.map +1 -1
  150. package/dist/pagination.js +78 -86
  151. package/dist/popover.cjs +1 -1
  152. package/dist/popover.d.ts +59 -4
  153. package/dist/popover.d.ts.map +1 -1
  154. package/dist/popover.js +42 -34
  155. package/dist/progress.cjs +1 -1
  156. package/dist/progress.d.ts +9 -2
  157. package/dist/progress.d.ts.map +1 -1
  158. package/dist/progress.js +71 -59
  159. package/dist/radio-group.cjs +1 -1
  160. package/dist/radio-group.d.ts +33 -10
  161. package/dist/radio-group.d.ts.map +1 -1
  162. package/dist/radio-group.js +56 -66
  163. package/dist/rating.d.ts +4 -0
  164. package/dist/rating.d.ts.map +1 -1
  165. package/dist/resizable.cjs +1 -1
  166. package/dist/resizable.d.ts +58 -6
  167. package/dist/resizable.d.ts.map +1 -1
  168. package/dist/resizable.js +38 -37
  169. package/dist/scroll-area.cjs +1 -1
  170. package/dist/scroll-area.d.ts +46 -5
  171. package/dist/scroll-area.d.ts.map +1 -1
  172. package/dist/scroll-area.js +42 -38
  173. package/dist/select.cjs +1 -1
  174. package/dist/select.d.ts +30 -0
  175. package/dist/select.d.ts.map +1 -1
  176. package/dist/select.js +64 -54
  177. package/dist/separator.cjs +1 -1
  178. package/dist/separator.d.ts +52 -5
  179. package/dist/separator.d.ts.map +1 -1
  180. package/dist/separator.js +45 -35
  181. package/dist/sheet.cjs +1 -1
  182. package/dist/sheet.d.ts +85 -19
  183. package/dist/sheet.d.ts.map +1 -1
  184. package/dist/sheet.js +117 -115
  185. package/dist/skeleton.cjs +1 -1
  186. package/dist/skeleton.d.ts +24 -2
  187. package/dist/skeleton.d.ts.map +1 -1
  188. package/dist/skeleton.js +15 -9
  189. package/dist/slider.cjs +1 -1
  190. package/dist/slider.d.ts +18 -4
  191. package/dist/slider.d.ts.map +1 -1
  192. package/dist/slider.js +72 -66
  193. package/dist/sonner.cjs +1 -1
  194. package/dist/sonner.d.ts +21 -22
  195. package/dist/sonner.d.ts.map +1 -1
  196. package/dist/sonner.js +46 -48
  197. package/dist/split-layout.d.ts +4 -1
  198. package/dist/split-layout.d.ts.map +1 -1
  199. package/dist/switch.cjs +1 -1
  200. package/dist/switch.d.ts +2 -12
  201. package/dist/switch.d.ts.map +1 -1
  202. package/dist/switch.js +37 -41
  203. package/dist/table.cjs +1 -1
  204. package/dist/table.d.ts +16 -12
  205. package/dist/table.d.ts.map +1 -1
  206. package/dist/table.js +56 -58
  207. package/dist/tabs.d.ts +27 -3
  208. package/dist/tabs.d.ts.map +1 -1
  209. package/dist/toggle-group.cjs +1 -1
  210. package/dist/toggle-group.d.ts +57 -7
  211. package/dist/toggle-group.d.ts.map +1 -1
  212. package/dist/toggle-group.js +60 -67
  213. package/dist/toggle.cjs +1 -1
  214. package/dist/toggle.d.ts +12 -26
  215. package/dist/toggle.d.ts.map +1 -1
  216. package/dist/toggle.js +16 -20
  217. package/package.json +9 -3
  218. package/src/blocks/data-table.tsx +43 -33
  219. package/src/blocks/sidebar.tsx +158 -541
  220. package/src/components/accordion.tsx +164 -78
  221. package/src/components/alert-dialog.tsx +156 -111
  222. package/src/components/alert.tsx +27 -14
  223. package/src/components/aspect-ratio.tsx +25 -16
  224. package/src/components/avatar.tsx +56 -8
  225. package/src/components/badge.tsx +65 -42
  226. package/src/components/breadcrumb.tsx +159 -83
  227. package/src/components/button.tsx +42 -63
  228. package/src/components/calendar.tsx +22 -6
  229. package/src/components/card.tsx +92 -40
  230. package/src/components/carousel.tsx +240 -115
  231. package/src/components/centred-layout.tsx +68 -49
  232. package/src/components/chart.tsx +118 -47
  233. package/src/components/checkbox.tsx +43 -79
  234. package/src/components/collapsible.tsx +95 -26
  235. package/src/components/combobox.tsx +243 -153
  236. package/src/components/command.tsx +295 -121
  237. package/src/components/context-menu.tsx +279 -82
  238. package/src/components/date-picker.tsx +282 -31
  239. package/src/components/description.tsx +60 -0
  240. package/src/components/dialog.tsx +163 -87
  241. package/src/components/drawer.tsx +76 -2
  242. package/src/components/dropdown-menu.tsx +143 -37
  243. package/src/components/field.tsx +38 -11
  244. package/src/components/global-layout.tsx +116 -77
  245. package/src/components/hover-card.tsx +54 -14
  246. package/src/components/input-group.tsx +56 -18
  247. package/src/components/input-otp.tsx +1 -1
  248. package/src/components/input-password.tsx +4 -5
  249. package/src/components/input.tsx +93 -186
  250. package/src/components/label.tsx +56 -15
  251. package/src/components/link.tsx +1 -1
  252. package/src/components/logo.tsx +12 -7
  253. package/src/components/menubar.tsx +61 -5
  254. package/src/components/navigation-menu.tsx +37 -99
  255. package/src/components/pagination.tsx +13 -19
  256. package/src/components/popover.tsx +103 -20
  257. package/src/components/progress.tsx +82 -60
  258. package/src/components/radio-group.tsx +44 -25
  259. package/src/components/rating.tsx +4 -0
  260. package/src/components/resizable.tsx +88 -38
  261. package/src/components/scroll-area.tsx +123 -56
  262. package/src/components/select.tsx +22 -2
  263. package/src/components/separator.tsx +101 -24
  264. package/src/components/sheet.tsx +186 -90
  265. package/src/components/skeleton.tsx +40 -10
  266. package/src/components/slider.tsx +83 -57
  267. package/src/components/sonner.tsx +34 -34
  268. package/src/components/split-layout.tsx +4 -1
  269. package/src/components/switch.figma.tsx +7 -11
  270. package/src/components/switch.tsx +9 -19
  271. package/src/components/table.tsx +23 -18
  272. package/src/components/tabs.tsx +27 -3
  273. package/src/components/toggle-group.tsx +115 -86
  274. package/src/components/toggle.figma.tsx +13 -19
  275. package/src/components/toggle.tsx +20 -34
  276. package/src/index.ts +1 -1
  277. package/dist/input-base.cjs +0 -1
  278. package/dist/input-base.d.ts +0 -28
  279. package/dist/input-base.d.ts.map +0 -1
  280. package/dist/input-base.js +0 -56
  281. package/src/components/input-base.tsx +0 -86
@@ -1,91 +1,86 @@
1
- import { jsxs as m, jsx as o } from "react/jsx-runtime";
1
+ import { jsxs as d, jsx as o } from "react/jsx-runtime";
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;A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as s, jsxs as h } from "react/jsx-runtime";
2
2
  import * as l from "react";
3
- import { ChevronLeftIcon as v, ChevronRightIcon as x, MoreHorizontalIcon as b } from "lucide-react";
3
+ import { ChevronLeftIcon as v, ChevronRightIcon as x, MoreHorizontalIcon as b } from "@brightlocal/icons";
4
4
  import { cva as N } from "class-variance-authority";
5
5
  import { cn as f } from "@brightlocal/ui-components/lib/utils";
6
- var k = /* @__PURE__ */ ((i) => (i.PREVIOUS = "previous", i.NEXT = "next", i.LINK = "link", i.ELLIPSIS = "ellipsis", i))(k || {});
7
- function S({
8
- page: i,
9
- totalPages: e,
10
- siblingCount: r = 1,
6
+ function L({
7
+ page: t,
8
+ totalPages: i,
9
+ siblingCount: n = 1,
11
10
  boundaryCount: a = 1
12
11
  }) {
13
12
  return l.useMemo(() => {
14
- const n = [];
15
- n.push("previous");
16
- const c = Math.max(i - r, a + 1), p = Math.min(
17
- i + r,
18
- e - a
19
- ), g = c > a + 2, m = p < e - a - 1;
20
- for (let t = 1; t <= Math.min(a, e); t++)
21
- n.push(t);
13
+ const r = [];
14
+ r.push("previous");
15
+ const c = Math.max(t - n, a + 1), p = Math.min(
16
+ t + n,
17
+ i - a
18
+ ), g = c > a + 2, m = p < i - a - 1;
19
+ for (let e = 1; e <= Math.min(a, i); e++)
20
+ r.push(e);
22
21
  if (g)
23
- n.push("ellipsis");
22
+ r.push("ellipsis");
24
23
  else if (a + 1 < c)
25
- for (let t = a + 1; t < c; t++)
26
- n.push(t);
27
- for (let t = c; t <= p; t++)
28
- t > a && t <= e - a && n.push(t);
24
+ for (let e = a + 1; e < c; e++)
25
+ r.push(e);
26
+ for (let e = c; e <= p; e++)
27
+ e > a && e <= i - a && r.push(e);
29
28
  if (m)
30
- n.push("ellipsis");
31
- else if (p < e - a)
32
- for (let t = p + 1; t < e - a + 1; t++)
33
- n.push(t);
34
- for (let t = Math.max(e - a + 1, a + 1); t <= e; t++)
35
- t > a && n.push(t);
36
- return n.push("next"), n;
37
- }, [i, e, r, a]);
29
+ r.push("ellipsis");
30
+ else if (p < i - a)
31
+ for (let e = p + 1; e < i - a + 1; e++)
32
+ r.push(e);
33
+ for (let e = Math.max(i - a + 1, a + 1); e <= i; e++)
34
+ e > a && r.push(e);
35
+ return r.push("next"), r;
36
+ }, [t, i, n, a]);
38
37
  }
39
38
  const u = N(
40
39
  [
@@ -77,55 +76,55 @@ const u = N(
77
76
  },
78
77
  defaultVariants: {
79
78
  variant: "link"
80
- /* LINK */
81
79
  }
82
80
  }
83
81
  );
84
- function j({
85
- className: i,
86
- dataHook: e,
87
- trackingEl: r,
82
+ function k({
83
+ className: t,
84
+ dataHook: i,
85
+ trackingEl: n,
88
86
  trackingLabel: a,
89
87
  ariaLabel: o = "Pagination",
90
- ...n
88
+ ...r
91
89
  }) {
92
90
  return /* @__PURE__ */ s(
93
91
  "nav",
94
92
  {
95
93
  "aria-label": o,
96
- className: f("mx-auto flex w-full justify-center", i),
97
- "data-hook": e,
94
+ className: f("mx-auto flex w-full justify-center", t),
95
+ "data-hook": i,
98
96
  "data-slot": "pagination",
99
- "data-tracking-el": r || "pagination",
97
+ "data-tracking-el": n || "pagination",
100
98
  "data-tracking-label": a,
101
99
  role: "navigation",
102
- ...n
100
+ ...r
103
101
  }
104
102
  );
105
103
  }
106
- function z({
107
- className: i,
108
- ...e
104
+ k.displayName = "Pagination";
105
+ function E({
106
+ className: t,
107
+ ...i
109
108
  }) {
110
109
  return /* @__PURE__ */ s(
111
110
  "ul",
112
111
  {
113
- className: f("flex flex-row items-center gap-2", i),
112
+ className: f("flex flex-row items-center gap-2", t),
114
113
  "data-slot": "pagination-content",
115
- ...e
114
+ ...i
116
115
  }
117
116
  );
118
117
  }
119
- function G(i) {
120
- return /* @__PURE__ */ s("li", { "data-slot": "pagination-item", ...i });
118
+ function G(t) {
119
+ return /* @__PURE__ */ s("li", { "data-slot": "pagination-item", ...t });
121
120
  }
122
- const d = l.forwardRef(({ className: i, variant: e, isActive: r, children: a, ...o }, n) => /* @__PURE__ */ s(
121
+ const d = l.forwardRef(({ className: t, variant: i, isActive: n, children: a, ...o }, r) => /* @__PURE__ */ s(
123
122
  "button",
124
123
  {
125
- ref: n,
126
- "aria-current": r ? "page" : void 0,
127
- className: f(u({ variant: e }), i),
128
- "data-active": r,
124
+ ref: r,
125
+ "aria-current": n ? "page" : void 0,
126
+ className: f(u({ variant: i }), t),
127
+ "data-active": n,
129
128
  "data-slot": "pagination-button",
130
129
  type: "button",
131
130
  ...o,
@@ -133,68 +132,62 @@ const d = l.forwardRef(({ className: i, variant: e, isActive: r, children: a, ..
133
132
  }
134
133
  ));
135
134
  d.displayName = "PaginationButton";
136
- const I = l.forwardRef(({ className: i, disabled: e, ...r }, a) => /* @__PURE__ */ s(
135
+ const w = l.forwardRef(({ className: t, disabled: i, ...n }, a) => /* @__PURE__ */ s(
137
136
  d,
138
137
  {
139
138
  ref: a,
140
- "aria-disabled": e,
139
+ "aria-disabled": i,
141
140
  "aria-label": "Go to previous page",
142
- className: i,
143
- disabled: e,
141
+ className: t,
142
+ disabled: i,
144
143
  variant: "previous",
145
- ...r,
144
+ ...n,
146
145
  children: /* @__PURE__ */ s(v, { className: "size-4" })
147
146
  }
148
147
  ));
149
- I.displayName = "PaginationPrevious";
150
- const w = l.forwardRef(
151
- ({ className: i, disabled: e, ...r }, a) => /* @__PURE__ */ s(
148
+ w.displayName = "PaginationPrevious";
149
+ const P = l.forwardRef(
150
+ ({ className: t, disabled: i, ...n }, a) => /* @__PURE__ */ s(
152
151
  d,
153
152
  {
154
153
  ref: a,
155
- "aria-disabled": e,
154
+ "aria-disabled": i,
156
155
  "aria-label": "Go to next page",
157
- className: i,
158
- disabled: e,
156
+ className: t,
157
+ disabled: i,
159
158
  variant: "next",
160
- ...r,
159
+ ...n,
161
160
  children: /* @__PURE__ */ s(x, { className: "size-4" })
162
161
  }
163
162
  )
164
163
  );
165
- w.displayName = "PaginationNext";
166
- const R = l.forwardRef(
167
- ({ className: i, page: e, isActive: r, ...a }, o) => /* @__PURE__ */ s(
164
+ P.displayName = "PaginationNext";
165
+ const I = l.forwardRef(
166
+ ({ className: t, page: i, isActive: n, ...a }, o) => /* @__PURE__ */ s(
168
167
  d,
169
168
  {
170
169
  ref: o,
171
- "aria-label": `Go to page ${e}`,
172
- className: i,
173
- isActive: r,
170
+ "aria-label": `Go to page ${i}`,
171
+ className: t,
172
+ isActive: n,
174
173
  variant: "link",
175
174
  ...a,
176
- children: e
175
+ children: i
177
176
  }
178
177
  )
179
178
  );
180
- R.displayName = "PaginationLink";
179
+ I.displayName = "PaginationLink";
181
180
  function B({
182
- className: i,
183
- ...e
181
+ className: t,
182
+ ...i
184
183
  }) {
185
184
  return /* @__PURE__ */ h(
186
185
  "span",
187
186
  {
188
187
  "aria-hidden": "true",
189
- className: f(
190
- u({
191
- variant: "ellipsis"
192
- /* ELLIPSIS */
193
- }),
194
- i
195
- ),
188
+ className: f(u({ variant: "ellipsis" }), t),
196
189
  "data-slot": "pagination-ellipsis",
197
- ...e,
190
+ ...i,
198
191
  children: [
199
192
  /* @__PURE__ */ s(b, { className: "size-4" }),
200
193
  /* @__PURE__ */ s("span", { className: "sr-only", children: "More pages" })
@@ -203,14 +196,13 @@ function B({
203
196
  );
204
197
  }
205
198
  export {
206
- j as Pagination,
199
+ k as Pagination,
207
200
  d as PaginationButton,
208
- z as PaginationContent,
201
+ E as PaginationContent,
209
202
  B as PaginationEllipsis,
210
203
  G as PaginationItem,
211
- R as PaginationLink,
212
- w as PaginationNext,
213
- I as PaginationPrevious,
214
- k as PaginationVariant,
215
- S as usePagination
204
+ I as PaginationLink,
205
+ P as PaginationNext,
206
+ w as PaginationPrevious,
207
+ L as usePagination
216
208
  };
package/dist/popover.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),i=require("@radix-ui/react-popover"),d=require("@brightlocal/ui-components/lib/utils");function s(e){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(o,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return o.default=e,Object.freeze(o)}const n=s(i);function p({...e}){return r.jsx(n.Root,{"data-slot":"popover",...e})}function c({...e}){return r.jsx(n.Trigger,{"data-slot":"popover-trigger",...e})}function u({className:e,align:o="center",sideOffset:t=4,...a}){return r.jsx(n.Portal,{children:r.jsx(n.Content,{align:o,className:d.cn("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 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),"data-slot":"popover-content",sideOffset:t,...a})})}function l({...e}){return r.jsx(n.Anchor,{"data-slot":"popover-anchor",...e})}exports.Popover=p;exports.PopoverAnchor=l;exports.PopoverContent=u;exports.PopoverTrigger=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react/jsx-runtime"),u=require("react"),v=require("@radix-ui/react-popover"),g=require("@brightlocal/ui-components/lib/utils");function d(o){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(o){for(const e in o)if(e!=="default"){const n=Object.getOwnPropertyDescriptor(o,e);Object.defineProperty(t,e,n.get?n:{enumerable:!0,get:()=>o[e]})}}return t.default=o,Object.freeze(t)}const i=d(u),a=d(v);function s({...o}){return r.jsx(a.Root,{"data-slot":"popover",...o})}s.displayName="Popover";const p=i.forwardRef(({dataHook:o,...t},e)=>r.jsx(a.Trigger,{ref:e,"data-hook":o,"data-slot":"popover-trigger",...t}));p.displayName="PopoverTrigger";const c=i.forwardRef(({className:o,align:t="center",sideOffset:e=4,dataHook:n,...f},m)=>r.jsx(a.Portal,{children:r.jsx(a.Content,{ref:m,align:t,className:g.cn("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 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",o),"data-hook":n,"data-slot":"popover-content",sideOffset:e,...f})}));c.displayName="PopoverContent";const l=i.forwardRef(({dataHook:o,...t},e)=>r.jsx(a.Anchor,{ref:e,"data-hook":o,"data-slot":"popover-anchor",...t}));l.displayName="PopoverAnchor";exports.Popover=s;exports.PopoverAnchor=l;exports.PopoverContent=c;exports.PopoverTrigger=p;
package/dist/popover.d.ts CHANGED
@@ -1,8 +1,63 @@
1
1
  import * as React from "react";
2
2
  import * as PopoverPrimitive from "@radix-ui/react-popover";
3
- declare function Popover({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
4
- declare function PopoverTrigger({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Trigger>): import("react/jsx-runtime").JSX.Element;
5
- declare function PopoverContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof PopoverPrimitive.Content>): import("react/jsx-runtime").JSX.Element;
6
- declare function PopoverAnchor({ ...props }: React.ComponentProps<typeof PopoverPrimitive.Anchor>): import("react/jsx-runtime").JSX.Element;
3
+ export interface PopoverProps extends React.ComponentProps<typeof PopoverPrimitive.Root> {
4
+ /** The open state when initially rendered. Use when you do not need to control the open state. */
5
+ defaultOpen?: boolean;
6
+ /** The controlled open state of the popover. */
7
+ open?: boolean;
8
+ /** Event handler called when the open state of the popover changes. */
9
+ onOpenChange?: (open: boolean) => void;
10
+ /** When true, interaction with outside elements is disabled and only popover content is visible to screen readers. */
11
+ modal?: boolean;
12
+ }
13
+ /**
14
+ * Contains all the parts of a popover.
15
+ */
16
+ declare function Popover({ ...props }: PopoverProps): import("react/jsx-runtime").JSX.Element;
17
+ declare namespace Popover {
18
+ var displayName: string;
19
+ }
20
+ export interface PopoverTriggerProps extends React.ComponentProps<typeof PopoverPrimitive.Trigger> {
21
+ /** Change the default rendered element for the one passed as a child, merging their props and behavior. */
22
+ asChild?: boolean;
23
+ /** Test hook identifier for testing purposes. */
24
+ dataHook?: string;
25
+ }
26
+ /**
27
+ * The button that toggles the popover.
28
+ */
29
+ declare const PopoverTrigger: React.ForwardRefExoticComponent<Omit<PopoverTriggerProps, "ref"> & React.RefAttributes<HTMLButtonElement>>;
30
+ export interface PopoverContentProps extends React.ComponentProps<typeof PopoverPrimitive.Content> {
31
+ /** Test hook identifier for testing purposes. */
32
+ dataHook?: string;
33
+ /** The preferred side of the anchor to render against. Will be reversed when collisions occur. */
34
+ side?: "top" | "right" | "bottom" | "left";
35
+ /** The distance in pixels from the anchor. */
36
+ sideOffset?: number;
37
+ /** The preferred alignment against the anchor. May change when collisions occur. */
38
+ align?: "start" | "center" | "end";
39
+ /** An offset in pixels from the "start" or "end" alignment options. */
40
+ alignOffset?: number;
41
+ /** When true, overrides side and align to prevent collisions with boundary edges. */
42
+ avoidCollisions?: boolean;
43
+ /** The sticky behavior on the align axis. "partial" keeps content in boundary as long as trigger is at least partially in boundary. */
44
+ sticky?: "partial" | "always";
45
+ /** Whether to hide content when the trigger becomes fully occluded. */
46
+ hideWhenDetached?: boolean;
47
+ }
48
+ /**
49
+ * The component that pops out when the popover is open.
50
+ */
51
+ declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverContentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
52
+ export interface PopoverAnchorProps extends React.ComponentProps<typeof PopoverPrimitive.Anchor> {
53
+ /** Change the default rendered element for the one passed as a child, merging their props and behavior. */
54
+ asChild?: boolean;
55
+ /** Test hook identifier for testing purposes. */
56
+ dataHook?: string;
57
+ }
58
+ /**
59
+ * An optional element to position the popover against. If not used, the popover will position against the trigger.
60
+ */
61
+ declare const PopoverAnchor: React.ForwardRefExoticComponent<Omit<PopoverAnchorProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
7
62
  export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor };
8
63
  //# sourceMappingURL=popover.d.ts.map