@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,5 +1,8 @@
1
1
  import { DayButton, DayPickerProps } from 'react-day-picker';
2
2
  import * as React from "react";
3
+ /**
4
+ * Props for the Calendar component
5
+ */
3
6
  export type CalendarProps = DayPickerProps & {
4
7
  /**
5
8
  * Number of months to display (1-3)
@@ -19,7 +22,19 @@ export type CalendarProps = DayPickerProps & {
19
22
  */
20
23
  trackingLabel?: string;
21
24
  };
22
- declare function CalendarDayButton({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
25
+ /**
26
+ * Custom day button component for the Calendar.
27
+ * Renders individual day cells with proper styling and selection states.
28
+ */
29
+ declare const CalendarDayButton: {
30
+ ({ className, day, modifiers, ...props }: React.ComponentProps<typeof DayButton>): import("react/jsx-runtime").JSX.Element;
31
+ displayName: string;
32
+ };
33
+ /**
34
+ * Calendar component for date and range selection.
35
+ * Supports single date, multiple dates, and date range selection modes.
36
+ * Built on top of react-day-picker with custom styling and navigation.
37
+ */
23
38
  declare function Calendar({ className, classNames, showOutsideDays, numberOfMonths, captionLayout, fixedWeeks, dataHook, trackingEl, trackingLabel, components, formatters, ...props }: CalendarProps): import("react/jsx-runtime").JSX.Element;
24
39
  declare namespace Calendar {
25
40
  var displayName: string;
@@ -1 +1 @@
1
- {"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../src/components/calendar.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACL,SAAS,EAGT,KAAK,cAAc,EACpB,MAAM,kBAAkB,CAAC;AAI1B,MAAM,MAAM,aAAa,GAAG,cAAc,GAAG;IAC3C;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC3B;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IACjB;;OAE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ACb,UAAU,EACV,UAAU,EACV,GAAG,KAAK,EACT,EAAE,aAAa,2CAqIf;kBAlJQ,QAAQ;;;AAsJjB,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAAE,CAAC"}
package/dist/calendar.js CHANGED
@@ -1,20 +1,20 @@
1
1
  import { jsx as a } from "react/jsx-runtime";
2
2
  import * as g from "react";
3
- import { ChevronLeft as _, ChevronRight as v, ChevronDown as k } from "lucide-react";
4
- import { getDefaultClassNames as m, DayPicker as N } from "react-day-picker";
3
+ import { ChevronLeft as v, ChevronRight as k, ChevronDown as N } from "@brightlocal/icons";
4
+ import { getDefaultClassNames as m, DayPicker as C } from "react-day-picker";
5
5
  import { cn as e } from "@brightlocal/ui-components/lib/utils";
6
6
  const f = e(
7
- "inline-flex items-center justify-center rounded-md bg-background",
7
+ "inline-flex items-center justify-center rounded-md",
8
+ "text-muted-foreground hover:text-foreground",
8
9
  "hover:bg-accent hover:text-accent-foreground",
9
10
  "focus-visible:outline-none focus-visible:shadow-default",
10
- "h-8 w-8 p-0 opacity-50 hover:opacity-100"
11
- );
12
- function z({
11
+ "h-8 w-8 p-0"
12
+ ), p = ({
13
13
  className: s,
14
14
  day: l,
15
15
  modifiers: r,
16
16
  ...u
17
- }) {
17
+ }) => {
18
18
  const n = m(), d = g.useRef(null);
19
19
  return g.useEffect(() => {
20
20
  r.focused && d.current?.focus();
@@ -43,24 +43,25 @@ function z({
43
43
  ...u
44
44
  }
45
45
  );
46
- }
47
- function C({
46
+ };
47
+ p.displayName = "CalendarDayButton";
48
+ function z({
48
49
  className: s,
49
50
  classNames: l,
50
51
  showOutsideDays: r = !0,
51
52
  numberOfMonths: u = 1,
52
53
  captionLayout: n,
53
54
  fixedWeeks: d = !0,
54
- dataHook: p,
55
- trackingEl: x,
56
- trackingLabel: h,
57
- components: b,
58
- formatters: w,
59
- ...y
55
+ dataHook: x,
56
+ trackingEl: h,
57
+ trackingLabel: b,
58
+ components: w,
59
+ formatters: y,
60
+ ..._
60
61
  }) {
61
62
  const t = m();
62
63
  return /* @__PURE__ */ a(
63
- N,
64
+ C,
64
65
  {
65
66
  captionLayout: n,
66
67
  className: e(
@@ -149,43 +150,44 @@ function C({
149
150
  className: c,
150
151
  ...i
151
152
  }) => o === "left" ? /* @__PURE__ */ a(
152
- _,
153
+ v,
153
154
  {
154
155
  className: e("size-4", c),
155
156
  ...i
156
157
  }
157
158
  ) : o === "right" ? /* @__PURE__ */ a(
158
- v,
159
+ k,
159
160
  {
160
161
  className: e("size-4", c),
161
162
  ...i
162
163
  }
163
164
  ) : /* @__PURE__ */ a(
164
- k,
165
+ N,
165
166
  {
166
167
  className: e("size-4", c),
167
168
  ...i
168
169
  }
169
170
  ),
170
- DayButton: z,
171
- ...b
171
+ DayButton: p,
172
+ ...w
172
173
  },
173
- "data-hook": p,
174
- "data-tracking-el": x,
175
- "data-tracking-label": h,
174
+ "data-hook": x,
175
+ "data-slot": "calendar",
176
+ "data-tracking-el": h,
177
+ "data-tracking-label": b,
176
178
  fixedWeeks: d,
177
179
  formatters: {
178
180
  formatMonthDropdown: (o) => o.toLocaleString("default", { month: "short" }),
179
- ...w
181
+ ...y
180
182
  },
181
183
  numberOfMonths: u,
182
184
  showOutsideDays: r,
183
- ...y
185
+ ..._
184
186
  }
185
187
  );
186
188
  }
187
- C.displayName = "Calendar";
189
+ z.displayName = "Calendar";
188
190
  export {
189
- C as Calendar,
190
- z as CalendarDayButton
191
+ z as Calendar,
192
+ p as CalendarDayButton
191
193
  };
package/dist/card.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),u=require("react"),f=require("class-variance-authority"),e=require("@brightlocal/ui-components/lib/utils");function g(t){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>t[n]})}}return r.default=t,Object.freeze(r)}const p=g(u);var d=(t=>(t.DEFAULT="default",t.TRANSPARENT="transparent",t.BORDER="border",t))(d||{});const m=f.cva(["flex","flex-col","gap-8","rounded-[14px]","py-8","transition-colors"],{variants:{variant:{default:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"]}},defaultVariants:{variant:"default"}}),s=p.forwardRef(({className:t,variant:r="default",dataHook:n,trackingEl:o,trackingLabel:c,...i},l)=>a.jsx("div",{ref:l,className:e.cn(m({variant:r}),t),"data-hook":n,"data-slot":"card","data-tracking-el":o||`card-${r}`,"data-tracking-label":c,...i}));s.displayName="Card";function b({className:t,...r}){return a.jsx("div",{className:e.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",t),"data-slot":"card-header",...r})}function x({className:t,...r}){return a.jsx("div",{className:e.cn("heading-sm",t),"data-slot":"card-title",...r})}function C({className:t,...r}){return a.jsx("div",{className:e.cn("text-muted-foreground text-sm leading-normal font-normal",t),"data-slot":"card-description",...r})}function j({className:t,...r}){return a.jsx("div",{className:e.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",t),"data-slot":"card-action",...r})}function v({className:t,...r}){return a.jsx("div",{className:e.cn("px-8",t),"data-slot":"card-content",...r})}function N({className:t,...r}){return a.jsx("div",{className:e.cn("flex items-center px-8",t),"data-slot":"card-footer",...r})}exports.Card=s;exports.CardAction=j;exports.CardContent=v;exports.CardDescription=C;exports.CardFooter=N;exports.CardHeader=b;exports.CardTitle=x;exports.CardVariant=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),x=require("react"),b=require("class-variance-authority"),d=require("@brightlocal/ui-components/lib/utils");function y(a){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const s=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(r,t,s.get?s:{enumerable:!0,get:()=>a[t]})}}return r.default=a,Object.freeze(r)}const o=y(x),N=b.cva(["flex","flex-col","gap-8","rounded-[14px]","py-8","transition-colors"],{variants:{variant:{default:["bg-card","text-card-foreground","border","border-card-border"],transparent:["bg-transparent","text-foreground"],border:["bg-transparent","text-foreground","border","border-border"]}},defaultVariants:{variant:"default"}}),n=o.forwardRef(({className:a,variant:r="default",dataHook:t,trackingEl:s,trackingLabel:m,...C},g)=>e.jsx("div",{ref:g,className:d.cn(N({variant:r}),a),"data-hook":t,"data-slot":"card","data-tracking-el":s||`card-${r}`,"data-tracking-label":m,...C}));n.displayName="Card";const c=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",a),"data-slot":"card-header",...r}));c.displayName="CardHeader";const i=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("heading-sm",a),"data-slot":"card-title",...r}));i.displayName="CardTitle";const l=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("text-muted-foreground text-sm leading-normal font-normal",a),"data-slot":"card-description",...r}));l.displayName="CardDescription";const f=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("col-start-2 row-span-2 row-start-1 self-start justify-self-end",a),"data-slot":"card-action",...r}));f.displayName="CardAction";const u=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("px-8",a),"data-slot":"card-content",...r}));u.displayName="CardContent";const p=o.forwardRef(({className:a,...r},t)=>e.jsx("div",{ref:t,className:d.cn("flex items-center px-8",a),"data-slot":"card-footer",...r}));p.displayName="CardFooter";exports.Card=n;exports.CardAction=f;exports.CardContent=u;exports.CardDescription=l;exports.CardFooter=p;exports.CardHeader=c;exports.CardTitle=i;
package/dist/card.d.ts CHANGED
@@ -1,28 +1,68 @@
1
1
  import * as React from "react";
2
2
  /**
3
- * Available card visual variants
4
- */
5
- export declare enum CardVariant {
6
- /** Default card with background, border */
7
- DEFAULT = "default",
8
- /** Transparent card with no background or border */
9
- TRANSPARENT = "transparent",
10
- /** Card with border only, no background or shadow */
11
- BORDER = "border"
12
- }
3
+ * Props for the Card component
4
+ */
13
5
  type CardProps = React.ComponentProps<"div"> & {
14
- variant?: CardVariant;
6
+ /**
7
+ * Visual style variant of the card
8
+ * @default "default"
9
+ */
10
+ variant?: "default" | "transparent" | "border";
11
+ /**
12
+ * Data hook for automated testing (required)
13
+ */
15
14
  dataHook: string;
15
+ /**
16
+ * Tracking element identifier for analytics
17
+ */
16
18
  trackingEl?: string;
19
+ /**
20
+ * Tracking label for analytics context
21
+ */
17
22
  trackingLabel?: string;
18
23
  };
24
+ /**
25
+ * Container component for grouping related content with visual separation.
26
+ * Supports multiple visual variants for different contexts.
27
+ */
19
28
  declare const Card: React.ForwardRefExoticComponent<Omit<CardProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
20
- declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
21
- declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
22
- declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
23
- declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
24
- declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
25
- declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
29
+ /**
30
+ * Props for Card sub-components
31
+ */
32
+ type CardSubComponentProps = React.ComponentProps<"div"> & {
33
+ /**
34
+ * Additional CSS classes to apply
35
+ */
36
+ className?: string;
37
+ /**
38
+ * Content to render inside the component
39
+ */
40
+ children?: React.ReactNode;
41
+ };
42
+ /**
43
+ * Header section of the Card containing title and description.
44
+ */
45
+ declare const CardHeader: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
46
+ /**
47
+ * Title element within the Card header.
48
+ */
49
+ declare const CardTitle: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
50
+ /**
51
+ * Description text within the Card header.
52
+ */
53
+ declare const CardDescription: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
54
+ /**
55
+ * Action area within the Card header for buttons or controls.
56
+ */
57
+ declare const CardAction: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
58
+ /**
59
+ * Main content area of the Card.
60
+ */
61
+ declare const CardContent: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
62
+ /**
63
+ * Footer section of the Card for actions or metadata.
64
+ */
65
+ declare const CardFooter: React.ForwardRefExoticComponent<Omit<CardSubComponentProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
26
66
  export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
27
- export type { CardProps };
67
+ export type { CardProps, CardSubComponentProps };
28
68
  //# sourceMappingURL=card.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../src/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B;;GAEG;AACH,oBAAY,WAAW;IACrB,2CAA2C;IAC3C,OAAO,YAAY;IACnB,oDAAoD;IACpD,WAAW,gBAAgB;IAC3B,qDAAqD;IACrD,MAAM,WAAW;CAClB;AA4BD,KAAK,SAAS,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC7C,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,E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;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,QAAA,MAAM,IAAI,+FAwBT,CAAC;AAIF;;GAEG;AACH,KAAK,qBAAqB,GAAG,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IACzD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,SAAS,2GASd,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,eAAe,2GAYpB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GAYf,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,WAAW,2GAShB,CAAC;AAGF;;GAEG;AACH,QAAA,MAAM,UAAU,2GASf,CAAC;AAGF,OAAO,EACL,IAAI,EACJ,UAAU,EACV,UAAU,EACV,SAAS,EACT,UAAU,EACV,eAAe,EACf,WAAW,GACZ,CAAC;AAEF,YAAY,EAAE,SAAS,EAAE,qBAAqB,EAAE,CAAC"}
package/dist/card.js CHANGED
@@ -1,9 +1,8 @@
1
- import { jsx as t } from "react/jsx-runtime";
2
- import * as i from "react";
1
+ import { jsx as d } from "react/jsx-runtime";
2
+ import * as e from "react";
3
3
  import { cva as l } from "class-variance-authority";
4
- import { cn as e } from "@brightlocal/ui-components/lib/utils";
5
- var f = /* @__PURE__ */ ((r) => (r.DEFAULT = "default", r.TRANSPARENT = "transparent", r.BORDER = "border", r))(f || {});
6
- const u = l(
4
+ import { cn as o } from "@brightlocal/ui-components/lib/utils";
5
+ const f = l(
7
6
  ["flex", "flex-col", "gap-8", "rounded-[14px]", "py-8", "transition-colors"],
8
7
  {
9
8
  variants: {
@@ -25,107 +24,117 @@ const u = l(
25
24
  },
26
25
  defaultVariants: {
27
26
  variant: "default"
28
- /* DEFAULT */
29
27
  }
30
28
  }
31
- ), m = i.forwardRef(
29
+ ), m = e.forwardRef(
32
30
  ({
33
31
  className: r,
34
32
  variant: a = "default",
35
- dataHook: o,
36
- trackingEl: d,
33
+ dataHook: t,
34
+ trackingEl: s,
37
35
  trackingLabel: n,
38
- ...s
39
- }, c) => /* @__PURE__ */ t(
36
+ ...i
37
+ }, c) => /* @__PURE__ */ d(
40
38
  "div",
41
39
  {
42
40
  ref: c,
43
- className: e(u({ variant: a }), r),
44
- "data-hook": o,
41
+ className: o(f({ variant: a }), r),
42
+ "data-hook": t,
45
43
  "data-slot": "card",
46
- "data-tracking-el": d || `card-${a}`,
44
+ "data-tracking-el": s || `card-${a}`,
47
45
  "data-tracking-label": n,
48
- ...s
46
+ ...i
49
47
  }
50
48
  )
51
49
  );
52
50
  m.displayName = "Card";
53
- function b({ className: r, ...a }) {
54
- return /* @__PURE__ */ t(
51
+ const p = e.forwardRef(
52
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
55
53
  "div",
56
54
  {
57
- className: e(
55
+ ref: t,
56
+ className: o(
58
57
  "@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-8 has-data-[slot=card-action]:grid-cols-[1fr_auto]",
59
58
  r
60
59
  ),
61
60
  "data-slot": "card-header",
62
61
  ...a
63
62
  }
64
- );
65
- }
66
- function v({ className: r, ...a }) {
67
- return /* @__PURE__ */ t(
63
+ )
64
+ );
65
+ p.displayName = "CardHeader";
66
+ const g = e.forwardRef(
67
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
68
68
  "div",
69
69
  {
70
- className: e("heading-sm", r),
70
+ ref: t,
71
+ className: o("heading-sm", r),
71
72
  "data-slot": "card-title",
72
73
  ...a
73
74
  }
74
- );
75
- }
76
- function N({ className: r, ...a }) {
77
- return /* @__PURE__ */ t(
75
+ )
76
+ );
77
+ g.displayName = "CardTitle";
78
+ const u = e.forwardRef(
79
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
78
80
  "div",
79
81
  {
80
- className: e(
82
+ ref: t,
83
+ className: o(
81
84
  "text-muted-foreground text-sm leading-normal font-normal",
82
85
  r
83
86
  ),
84
87
  "data-slot": "card-description",
85
88
  ...a
86
89
  }
87
- );
88
- }
89
- function C({ className: r, ...a }) {
90
- return /* @__PURE__ */ t(
90
+ )
91
+ );
92
+ u.displayName = "CardDescription";
93
+ const C = e.forwardRef(
94
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
91
95
  "div",
92
96
  {
93
- className: e(
97
+ ref: t,
98
+ className: o(
94
99
  "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
95
100
  r
96
101
  ),
97
102
  "data-slot": "card-action",
98
103
  ...a
99
104
  }
100
- );
101
- }
102
- function R({ className: r, ...a }) {
103
- return /* @__PURE__ */ t(
105
+ )
106
+ );
107
+ C.displayName = "CardAction";
108
+ const x = e.forwardRef(
109
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
104
110
  "div",
105
111
  {
106
- className: e("px-8", r),
112
+ ref: t,
113
+ className: o("px-8", r),
107
114
  "data-slot": "card-content",
108
115
  ...a
109
116
  }
110
- );
111
- }
112
- function h({ className: r, ...a }) {
113
- return /* @__PURE__ */ t(
117
+ )
118
+ );
119
+ x.displayName = "CardContent";
120
+ const N = e.forwardRef(
121
+ ({ className: r, ...a }, t) => /* @__PURE__ */ d(
114
122
  "div",
115
123
  {
116
- className: e("flex items-center px-8", r),
124
+ ref: t,
125
+ className: o("flex items-center px-8", r),
117
126
  "data-slot": "card-footer",
118
127
  ...a
119
128
  }
120
- );
121
- }
129
+ )
130
+ );
131
+ N.displayName = "CardFooter";
122
132
  export {
123
133
  m as Card,
124
134
  C as CardAction,
125
- R as CardContent,
126
- N as CardDescription,
127
- h as CardFooter,
128
- b as CardHeader,
129
- v as CardTitle,
130
- f as CardVariant
135
+ x as CardContent,
136
+ u as CardDescription,
137
+ N as CardFooter,
138
+ p as CardHeader,
139
+ g as CardTitle
131
140
  };
package/dist/carousel.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("react/jsx-runtime"),P=require("react"),k=require("embla-carousel-react"),m=require("lucide-react"),i=require("@brightlocal/ui-components/lib/utils"),u=require("@brightlocal/ui-components/button");function O(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const l=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,l.get?l:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const s=O(P),p=s.createContext(null);function h(){const e=s.useContext(p);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}function R({orientation:e="horizontal",opts:r,setApi:t,plugins:l,className:f,children:d,...x}){const[C,o]=k({...r,axis:e==="horizontal"?"x":"y"},l),[N,S]=s.useState(!1),[j,y]=s.useState(!1),c=s.useCallback(a=>{a&&(S(a.canScrollPrev()),y(a.canScrollNext()))},[]),v=s.useCallback(()=>{o?.scrollPrev()},[o]),b=s.useCallback(()=>{o?.scrollNext()},[o]),w=s.useCallback(a=>{const g=e==="horizontal"?"ArrowLeft":"ArrowUp",z=e==="horizontal"?"ArrowRight":"ArrowDown";a.key===g?(a.preventDefault(),v()):a.key===z&&(a.preventDefault(),b())},[e,v,b]);return s.useEffect(()=>{!o||!t||t(o)},[o,t]),s.useEffect(()=>{if(o)return c(o),o.on("reInit",c),o.on("select",c),()=>{o?.off("reInit",c),o?.off("select",c)}},[o,c]),n.jsx(p.Provider,{value:{carouselRef:C,api:o,opts:r,orientation:e||(r?.axis==="y"?"vertical":"horizontal"),scrollPrev:v,scrollNext:b,canScrollPrev:N,canScrollNext:j},children:n.jsx("div",{"aria-roledescription":"carousel",className:i.cn("relative",f),"data-slot":"carousel",role:"region",onKeyDownCapture:w,...x,children:d})})}function D({className:e,...r}){const{carouselRef:t,orientation:l}=h();return n.jsx("div",{ref:t,className:i.cn("overflow-hidden",l==="vertical"&&"h-[400px]"),"data-slot":"carousel-content",children:n.jsx("div",{className:i.cn("flex gap-4",l==="horizontal"?"":"h-full flex-col",e),...r})})}function q({className:e,...r}){const{orientation:t}=h();return n.jsx("div",{"aria-roledescription":"slide",className:i.cn("min-w-0 shrink-0 grow-0 basis-full",t==="horizontal"?"pl-1":"pt-1",e),"data-slot":"carousel-item",role:"group",...r})}function B({className:e,variant:r=u.ButtonVariant.OUTLINE,size:t=u.ButtonSize.SM,dataHook:l="carousel-previous",...f}){const{orientation:d,scrollPrev:x,canScrollPrev:C}=h();return n.jsxs(u.Button,{className:i.cn("absolute size-8 rounded-full",d==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),"data-slot":"carousel-previous",dataHook:l,disabled:!C,size:t,variant:r,onClick:x,...f,children:[n.jsx(m.ArrowLeft,{}),n.jsx("span",{className:"sr-only",children:"Previous slide"})]})}function E({className:e,variant:r=u.ButtonVariant.OUTLINE,size:t=u.ButtonSize.SM,dataHook:l="carousel-next",...f}){const{orientation:d,scrollNext:x,canScrollNext:C}=h();return n.jsxs(u.Button,{className:i.cn("absolute size-8 rounded-full",d==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),"data-slot":"carousel-next",dataHook:l,disabled:!C,size:t,variant:r,onClick:x,...f,children:[n.jsx(m.ArrowRight,{}),n.jsx("span",{className:"sr-only",children:"Next slide"})]})}exports.Carousel=R;exports.CarouselContent=D;exports.CarouselItem=q;exports.CarouselNext=E;exports.CarouselPrevious=B;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),K=require("react"),_=require("embla-carousel-react"),N=require("@brightlocal/icons"),f=require("@brightlocal/ui-components/lib/utils"),h=require("@brightlocal/ui-components/button");function B(e){const r=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(r,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const l=B(K),p=l.createContext(null);function C(){const e=l.useContext(p);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const y=l.forwardRef(({orientation:e="horizontal",opts:r,setApi:t,plugins:a,className:u,children:n,dataHook:d,trackingEl:x,trackingLabel:P,...S},k)=>{const[R,o]=_({...r,axis:e==="horizontal"?"x":"y"},a),[z,O]=l.useState(!1),[D,q]=l.useState(!1),i=l.useCallback(c=>{c&&(O(c.canScrollPrev()),q(c.canScrollNext()))},[]),m=l.useCallback(()=>{o?.scrollPrev()},[o]),v=l.useCallback(()=>{o?.scrollNext()},[o]),I=l.useCallback(c=>{const A=e==="horizontal"?"ArrowLeft":"ArrowUp",E=e==="horizontal"?"ArrowRight":"ArrowDown";c.key===A?(c.preventDefault(),m()):c.key===E&&(c.preventDefault(),v())},[e,m,v]);return l.useEffect(()=>{!o||!t||t(o)},[o,t]),l.useEffect(()=>{if(o)return i(o),o.on("reInit",i),o.on("select",i),()=>{o?.off("reInit",i),o?.off("select",i)}},[o,i]),s.jsx(p.Provider,{value:{carouselRef:R,api:o,opts:r,orientation:e||(r?.axis==="y"?"vertical":"horizontal"),scrollPrev:m,scrollNext:v,canScrollPrev:z,canScrollNext:D},children:s.jsx("div",{ref:k,"aria-roledescription":"carousel",className:f.cn("relative",u),"data-hook":d,"data-slot":"carousel","data-tracking-el":x,"data-tracking-label":P,role:"region",onKeyDownCapture:I,...S,children:n})})});y.displayName="Carousel";const b=l.forwardRef(({className:e,...r},t)=>{const{carouselRef:a,orientation:u}=C(),n=u==="vertical";return s.jsx("div",{ref:a,className:f.cn("overflow-hidden",n&&"w-full",e),"data-slot":"carousel-content",children:s.jsx("div",{ref:t,className:f.cn("flex",n?"-mt-4 h-full w-full flex-col":"-ml-4"),...r})})});b.displayName="CarouselContent";const w=l.forwardRef(({className:e,...r},t)=>{const{orientation:a}=C();return s.jsx("div",{ref:t,"aria-roledescription":"slide",className:f.cn("min-w-0 shrink-0 grow-0 basis-full",a==="horizontal"?"pl-4":"w-full pt-4",e),"data-slot":"carousel-item",role:"group",...r})});w.displayName="CarouselItem";function j({className:e,variant:r="outline",size:t="default",dataHook:a="carousel-previous",...u}){const{orientation:n,scrollPrev:d,canScrollPrev:x}=C();return s.jsxs(h.Button,{iconOnly:!0,className:f.cn("absolute",n==="horizontal"?"top-1/2 -left-12 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),"data-slot":"carousel-previous",dataHook:a,disabled:!x,size:t,variant:r,onClick:d,...u,children:[s.jsx(N.ArrowLeft,{}),s.jsx("span",{className:"sr-only",children:"Previous slide"})]})}j.displayName="CarouselPrevious";function g({className:e,variant:r="outline",size:t="default",dataHook:a="carousel-next",...u}){const{orientation:n,scrollNext:d,canScrollNext:x}=C();return s.jsxs(h.Button,{iconOnly:!0,className:f.cn("absolute",n==="horizontal"?"top-1/2 -right-12 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),"data-slot":"carousel-next",dataHook:a,disabled:!x,size:t,variant:r,onClick:d,...u,children:[s.jsx(N.ArrowRight,{}),s.jsx("span",{className:"sr-only",children:"Next slide"})]})}g.displayName="CarouselNext";exports.Carousel=y;exports.CarouselContent=b;exports.CarouselItem=w;exports.CarouselNext=g;exports.CarouselPrevious=j;
@@ -1,21 +1,111 @@
1
1
  import { default as useEmblaCarousel, UseEmblaCarouselType } from 'embla-carousel-react';
2
- import { Button } from '../button';
2
+ import { ButtonProps } from '../button';
3
3
  import * as React from "react";
4
4
  type CarouselApi = UseEmblaCarouselType[1];
5
5
  type UseCarouselParameters = Parameters<typeof useEmblaCarousel>;
6
6
  type CarouselOptions = UseCarouselParameters[0];
7
7
  type CarouselPlugin = UseCarouselParameters[1];
8
- type CarouselProps = {
8
+ /**
9
+ * Props for the Carousel component.
10
+ */
11
+ interface CarouselProps extends React.ComponentProps<"div"> {
12
+ /**
13
+ * Data hook for automated testing (required)
14
+ */
15
+ dataHook: string;
16
+ /**
17
+ * Tracking element identifier for analytics
18
+ */
19
+ trackingEl?: string;
20
+ /**
21
+ * Tracking label for analytics context
22
+ */
23
+ trackingLabel?: string;
24
+ /**
25
+ * Embla carousel options
26
+ */
9
27
  opts?: CarouselOptions;
28
+ /**
29
+ * Embla carousel plugins
30
+ */
10
31
  plugins?: CarouselPlugin;
32
+ /**
33
+ * Carousel orientation
34
+ * @default "horizontal"
35
+ */
11
36
  orientation?: "horizontal" | "vertical";
37
+ /**
38
+ * Callback to receive the carousel API instance
39
+ */
12
40
  setApi?: (api: CarouselApi) => void;
13
- };
14
- declare function Carousel({ orientation, opts, setApi, plugins, className, children, ...props }: React.ComponentProps<"div"> & CarouselProps): import("react/jsx-runtime").JSX.Element;
15
- declare function CarouselContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
16
- declare function CarouselItem({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
17
- declare function CarouselPrevious({ className, variant, size, dataHook, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
18
- declare function CarouselNext({ className, variant, size, dataHook, ...props }: React.ComponentProps<typeof Button>): import("react/jsx-runtime").JSX.Element;
41
+ }
42
+ /**
43
+ * Carousel component for displaying a scrollable series of content.
44
+ * Built on Embla Carousel for smooth touch-enabled sliding.
45
+ */
46
+ declare const Carousel: React.ForwardRefExoticComponent<Omit<CarouselProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
47
+ /**
48
+ * Container for carousel items with overflow handling.
49
+ */
50
+ declare const CarouselContent: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
51
+ /**
52
+ * Individual slide item within the carousel.
53
+ */
54
+ declare const CarouselItem: React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
55
+ /**
56
+ * Props for CarouselPrevious component.
57
+ */
58
+ interface CarouselPreviousProps extends Omit<ButtonProps, "variant" | "size" | "dataHook"> {
59
+ /**
60
+ * Visual style variant of the button
61
+ * @default "outline"
62
+ */
63
+ variant?: ButtonProps["variant"];
64
+ /**
65
+ * Size variant of the button
66
+ * @default "default"
67
+ */
68
+ size?: ButtonProps["size"];
69
+ /**
70
+ * Data hook for automated testing
71
+ * @default "carousel-previous"
72
+ */
73
+ dataHook?: string;
74
+ }
75
+ /**
76
+ * Button to navigate to the previous slide.
77
+ */
78
+ declare function CarouselPrevious({ className, variant, size, dataHook, ...props }: CarouselPreviousProps): import("react/jsx-runtime").JSX.Element;
79
+ declare namespace CarouselPrevious {
80
+ var displayName: string;
81
+ }
82
+ /**
83
+ * Props for CarouselNext component.
84
+ */
85
+ interface CarouselNextProps extends Omit<ButtonProps, "variant" | "size" | "dataHook"> {
86
+ /**
87
+ * Visual style variant of the button
88
+ * @default "outline"
89
+ */
90
+ variant?: ButtonProps["variant"];
91
+ /**
92
+ * Size variant of the button
93
+ * @default "default"
94
+ */
95
+ size?: ButtonProps["size"];
96
+ /**
97
+ * Data hook for automated testing
98
+ * @default "carousel-next"
99
+ */
100
+ dataHook?: string;
101
+ }
102
+ /**
103
+ * Button to navigate to the next slide.
104
+ */
105
+ declare function CarouselNext({ className, variant, size, dataHook, ...props }: CarouselNextProps): import("react/jsx-runtime").JSX.Element;
106
+ declare namespace CarouselNext {
107
+ var displayName: string;
108
+ }
19
109
  export { type CarouselApi, Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext, };
20
- export type { CarouselProps };
110
+ export type { CarouselProps, CarouselPreviousProps, CarouselNextProps };
21
111
  //# sourceMappingURL=carousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"carousel.d.ts","sourceRo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