@brightlocal/ui-components 0.1.2 → 0.1.3

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 (236) 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.d.ts +22 -1
  10. package/dist/alert.d.ts.map +1 -1
  11. package/dist/aspect-ratio.cjs +1 -1
  12. package/dist/aspect-ratio.d.ts +11 -1
  13. package/dist/aspect-ratio.d.ts.map +1 -1
  14. package/dist/aspect-ratio.js +16 -20
  15. package/dist/avatar.cjs +1 -1
  16. package/dist/avatar.d.ts +43 -3
  17. package/dist/avatar.d.ts.map +1 -1
  18. package/dist/avatar.js +18 -16
  19. package/dist/badge.cjs +1 -1
  20. package/dist/badge.d.ts +24 -9
  21. package/dist/badge.d.ts.map +1 -1
  22. package/dist/badge.js +34 -32
  23. package/dist/blocks/data-table.cjs +1 -1
  24. package/dist/blocks/data-table.d.ts.map +1 -1
  25. package/dist/blocks/data-table.js +177 -170
  26. package/dist/blocks/sidebar.cjs +1 -1
  27. package/dist/blocks/sidebar.d.ts +1 -1
  28. package/dist/blocks/sidebar.d.ts.map +1 -1
  29. package/dist/blocks/sidebar.js +154 -154
  30. package/dist/breadcrumb.cjs +1 -1
  31. package/dist/breadcrumb.d.ts +63 -8
  32. package/dist/breadcrumb.d.ts.map +1 -1
  33. package/dist/breadcrumb.js +97 -93
  34. package/dist/button.cjs +1 -1
  35. package/dist/button.d.ts +17 -45
  36. package/dist/button.d.ts.map +1 -1
  37. package/dist/button.js +49 -50
  38. package/dist/calendar.cjs +1 -1
  39. package/dist/calendar.d.ts +12 -0
  40. package/dist/calendar.d.ts.map +1 -1
  41. package/dist/calendar.js +10 -8
  42. package/dist/card.cjs +1 -1
  43. package/dist/card.d.ts +58 -18
  44. package/dist/card.d.ts.map +1 -1
  45. package/dist/card.js +60 -51
  46. package/dist/carousel.cjs +1 -1
  47. package/dist/carousel.d.ts +99 -9
  48. package/dist/carousel.d.ts.map +1 -1
  49. package/dist/carousel.js +142 -128
  50. package/dist/centred-layout.cjs +1 -1
  51. package/dist/centred-layout.d.ts +18 -2
  52. package/dist/centred-layout.d.ts.map +1 -1
  53. package/dist/centred-layout.js +46 -33
  54. package/dist/chart.cjs +4 -4
  55. package/dist/chart.d.ts +70 -7
  56. package/dist/chart.d.ts.map +1 -1
  57. package/dist/chart.js +71 -66
  58. package/dist/checkbox.cjs +1 -1
  59. package/dist/checkbox.d.ts +9 -5
  60. package/dist/checkbox.d.ts.map +1 -1
  61. package/dist/checkbox.js +61 -82
  62. package/dist/collapsible.cjs +1 -1
  63. package/dist/collapsible.d.ts +65 -8
  64. package/dist/collapsible.d.ts.map +1 -1
  65. package/dist/collapsible.js +41 -55
  66. package/dist/combobox.cjs +1 -1
  67. package/dist/combobox.d.ts +29 -11
  68. package/dist/combobox.d.ts.map +1 -1
  69. package/dist/combobox.js +193 -159
  70. package/dist/command.cjs +1 -1
  71. package/dist/command.d.ts +115 -9
  72. package/dist/command.d.ts.map +1 -1
  73. package/dist/command.js +176 -152
  74. package/dist/context-menu.cjs +1 -1
  75. package/dist/context-menu.d.ts +188 -20
  76. package/dist/context-menu.d.ts.map +1 -1
  77. package/dist/context-menu.js +119 -121
  78. package/dist/date-picker.cjs +1 -1
  79. package/dist/date-picker.d.ts +75 -9
  80. package/dist/date-picker.d.ts.map +1 -1
  81. package/dist/date-picker.js +220 -81
  82. package/dist/description.cjs +1 -0
  83. package/dist/description.d.ts +37 -0
  84. package/dist/description.d.ts.map +1 -0
  85. package/dist/description.js +25 -0
  86. package/dist/dialog.cjs +1 -1
  87. package/dist/dialog.d.ts +73 -9
  88. package/dist/dialog.d.ts.map +1 -1
  89. package/dist/dialog.js +103 -112
  90. package/dist/drawer.cjs +1 -1
  91. package/dist/drawer.d.ts +92 -0
  92. package/dist/drawer.d.ts.map +1 -1
  93. package/dist/drawer.js +67 -52
  94. package/dist/dropdown-menu.cjs +1 -1
  95. package/dist/dropdown-menu.d.ts +95 -11
  96. package/dist/dropdown-menu.d.ts.map +1 -1
  97. package/dist/dropdown-menu.js +146 -106
  98. package/dist/field.cjs +1 -1
  99. package/dist/field.d.ts +23 -6
  100. package/dist/field.d.ts.map +1 -1
  101. package/dist/field.js +54 -53
  102. package/dist/global-layout.cjs +1 -1
  103. package/dist/global-layout.d.ts +27 -17
  104. package/dist/global-layout.d.ts.map +1 -1
  105. package/dist/global-layout.js +86 -79
  106. package/dist/hover-card.cjs +1 -1
  107. package/dist/hover-card.d.ts +36 -6
  108. package/dist/hover-card.d.ts.map +1 -1
  109. package/dist/hover-card.js +44 -42
  110. package/dist/index.cjs +1 -1
  111. package/dist/index.d.ts +1 -1
  112. package/dist/index.d.ts.map +1 -1
  113. package/dist/index.js +383 -387
  114. package/dist/input-group.cjs +1 -1
  115. package/dist/input-group.d.ts +21 -2
  116. package/dist/input-group.d.ts.map +1 -1
  117. package/dist/input-group.js +51 -41
  118. package/dist/input-password.cjs +1 -1
  119. package/dist/input-password.d.ts.map +1 -1
  120. package/dist/input-password.js +24 -25
  121. package/dist/input.cjs +1 -1
  122. package/dist/input.d.ts +38 -24
  123. package/dist/input.d.ts.map +1 -1
  124. package/dist/input.js +68 -136
  125. package/dist/label.cjs +1 -1
  126. package/dist/label.d.ts +20 -1
  127. package/dist/label.d.ts.map +1 -1
  128. package/dist/label.js +31 -18
  129. package/dist/logo.cjs +1 -1
  130. package/dist/logo.d.ts +3 -0
  131. package/dist/logo.d.ts.map +1 -1
  132. package/dist/logo.js +12 -10
  133. package/dist/menubar.cjs +1 -1
  134. package/dist/menubar.d.ts +40 -6
  135. package/dist/menubar.d.ts.map +1 -1
  136. package/dist/menubar.js +97 -76
  137. package/dist/popover.cjs +1 -1
  138. package/dist/popover.d.ts +59 -4
  139. package/dist/popover.d.ts.map +1 -1
  140. package/dist/popover.js +42 -34
  141. package/dist/progress.cjs +1 -1
  142. package/dist/progress.d.ts +9 -2
  143. package/dist/progress.d.ts.map +1 -1
  144. package/dist/progress.js +71 -59
  145. package/dist/radio-group.d.ts +40 -0
  146. package/dist/radio-group.d.ts.map +1 -1
  147. package/dist/rating.d.ts +4 -0
  148. package/dist/rating.d.ts.map +1 -1
  149. package/dist/resizable.cjs +1 -1
  150. package/dist/resizable.d.ts +65 -4
  151. package/dist/resizable.d.ts.map +1 -1
  152. package/dist/resizable.js +53 -36
  153. package/dist/scroll-area.cjs +1 -1
  154. package/dist/scroll-area.d.ts +46 -5
  155. package/dist/scroll-area.d.ts.map +1 -1
  156. package/dist/scroll-area.js +42 -38
  157. package/dist/select.cjs +1 -1
  158. package/dist/select.d.ts +30 -0
  159. package/dist/select.d.ts.map +1 -1
  160. package/dist/select.js +64 -54
  161. package/dist/separator.cjs +1 -1
  162. package/dist/separator.d.ts +49 -2
  163. package/dist/separator.d.ts.map +1 -1
  164. package/dist/separator.js +48 -36
  165. package/dist/sheet.cjs +1 -1
  166. package/dist/sheet.d.ts +80 -9
  167. package/dist/sheet.d.ts.map +1 -1
  168. package/dist/sheet.js +117 -113
  169. package/dist/skeleton.cjs +1 -1
  170. package/dist/skeleton.d.ts +24 -2
  171. package/dist/skeleton.d.ts.map +1 -1
  172. package/dist/skeleton.js +15 -9
  173. package/dist/slider.cjs +1 -1
  174. package/dist/slider.d.ts +18 -4
  175. package/dist/slider.d.ts.map +1 -1
  176. package/dist/slider.js +72 -66
  177. package/dist/sonner.cjs +1 -1
  178. package/dist/sonner.d.ts +4 -2
  179. package/dist/sonner.d.ts.map +1 -1
  180. package/dist/sonner.js +29 -28
  181. package/dist/split-layout.d.ts +4 -1
  182. package/dist/split-layout.d.ts.map +1 -1
  183. package/package.json +8 -2
  184. package/src/blocks/data-table.tsx +42 -32
  185. package/src/blocks/sidebar.tsx +4 -12
  186. package/src/components/accordion.tsx +163 -77
  187. package/src/components/alert-dialog.tsx +156 -111
  188. package/src/components/alert.tsx +26 -13
  189. package/src/components/aspect-ratio.tsx +25 -16
  190. package/src/components/avatar.tsx +56 -8
  191. package/src/components/badge.tsx +65 -42
  192. package/src/components/breadcrumb.tsx +158 -82
  193. package/src/components/button.tsx +41 -62
  194. package/src/components/calendar.tsx +16 -2
  195. package/src/components/card.tsx +92 -40
  196. package/src/components/carousel.tsx +240 -115
  197. package/src/components/centred-layout.tsx +67 -35
  198. package/src/components/chart.tsx +118 -47
  199. package/src/components/checkbox.tsx +42 -78
  200. package/src/components/collapsible.tsx +95 -26
  201. package/src/components/combobox.tsx +242 -144
  202. package/src/components/command.tsx +295 -121
  203. package/src/components/context-menu.tsx +278 -81
  204. package/src/components/date-picker.tsx +281 -30
  205. package/src/components/description.tsx +60 -0
  206. package/src/components/dialog.tsx +162 -86
  207. package/src/components/drawer.tsx +76 -2
  208. package/src/components/dropdown-menu.tsx +143 -37
  209. package/src/components/field.tsx +36 -11
  210. package/src/components/global-layout.tsx +116 -77
  211. package/src/components/hover-card.tsx +54 -14
  212. package/src/components/input-group.tsx +56 -18
  213. package/src/components/input-password.tsx +3 -4
  214. package/src/components/input.tsx +93 -186
  215. package/src/components/label.tsx +56 -15
  216. package/src/components/logo.tsx +3 -0
  217. package/src/components/menubar.tsx +58 -4
  218. package/src/components/popover.tsx +103 -20
  219. package/src/components/progress.tsx +82 -60
  220. package/src/components/radio-group.tsx +40 -0
  221. package/src/components/rating.tsx +4 -0
  222. package/src/components/resizable.tsx +119 -31
  223. package/src/components/scroll-area.tsx +123 -56
  224. package/src/components/select.tsx +21 -1
  225. package/src/components/separator.tsx +97 -20
  226. package/src/components/sheet.tsx +180 -79
  227. package/src/components/skeleton.tsx +40 -10
  228. package/src/components/slider.tsx +83 -57
  229. package/src/components/sonner.tsx +10 -7
  230. package/src/components/split-layout.tsx +4 -1
  231. package/src/index.ts +1 -1
  232. package/dist/input-base.cjs +0 -1
  233. package/dist/input-base.d.ts +0 -28
  234. package/dist/input-base.d.ts.map +0 -1
  235. package/dist/input-base.js +0 -56
  236. package/src/components/input-base.tsx +0 -86
@@ -5,62 +5,150 @@ import * as ResizablePrimitive from "react-resizable-panels";
5
5
 
6
6
  import { cn } from "@brightlocal/ui-components/lib/utils";
7
7
 
8
- const ResizablePanelGroup = ({
9
- className,
10
- ...props
11
- }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
8
+ /**
9
+ * Props for the ResizablePanelGroup component.
10
+ */
11
+ interface ResizablePanelGroupProps extends React.ComponentProps<
12
+ typeof ResizablePrimitive.PanelGroup
13
+ > {
14
+ /**
15
+ * Data hook for automated testing
16
+ */
17
+ dataHook?: string;
18
+ /**
19
+ * Tracking element identifier for analytics
20
+ */
21
+ trackingEl?: string;
22
+ /**
23
+ * Tracking label for analytics context
24
+ */
25
+ trackingLabel?: string;
26
+ }
27
+
28
+ /**
29
+ * Container for resizable panels. Manages layout direction and panel sizing.
30
+ */
31
+ const ResizablePanelGroup = React.forwardRef<
32
+ React.ComponentRef<typeof ResizablePrimitive.PanelGroup>,
33
+ ResizablePanelGroupProps
34
+ >(({ className, dataHook, trackingEl, trackingLabel, ...props }, ref) => (
12
35
  <ResizablePrimitive.PanelGroup
36
+ ref={ref}
13
37
  className={cn(
14
38
  "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
15
39
  className
16
40
  )}
41
+ data-hook={dataHook}
17
42
  data-slot="resizable-panel-group"
43
+ data-tracking-el={trackingEl}
44
+ data-tracking-label={trackingLabel}
18
45
  {...props}
19
46
  />
20
- );
47
+ ));
21
48
 
22
- const ResizablePanel = ({
23
- ...props
24
- }: React.ComponentProps<typeof ResizablePrimitive.Panel>) => (
25
- <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
26
- );
49
+ ResizablePanelGroup.displayName = "ResizablePanelGroup";
50
+
51
+ /**
52
+ * Props for the ResizablePanel component.
53
+ */
54
+ interface ResizablePanelProps extends React.ComponentProps<
55
+ typeof ResizablePrimitive.Panel
56
+ > {
57
+ /**
58
+ * Data hook for automated testing
59
+ */
60
+ dataHook?: string;
61
+ /**
62
+ * Tracking element identifier for analytics
63
+ */
64
+ trackingEl?: string;
65
+ /**
66
+ * Tracking label for analytics context
67
+ */
68
+ trackingLabel?: string;
69
+ }
27
70
 
71
+ /**
72
+ * Individual resizable panel within a panel group.
73
+ */
74
+ const ResizablePanel = React.forwardRef<
75
+ React.ComponentRef<typeof ResizablePrimitive.Panel>,
76
+ ResizablePanelProps
77
+ >(({ dataHook, trackingEl, trackingLabel, ...props }, ref) => (
78
+ <ResizablePrimitive.Panel
79
+ ref={ref}
80
+ data-hook={dataHook}
81
+ data-slot="resizable-panel"
82
+ data-tracking-el={trackingEl}
83
+ data-tracking-label={trackingLabel}
84
+ {...props}
85
+ />
86
+ ));
87
+
88
+ ResizablePanel.displayName = "ResizablePanel";
89
+
90
+ /**
91
+ * Props for the ResizableHandle component.
92
+ */
28
93
  interface ResizableHandleProps extends React.ComponentProps<
29
94
  typeof ResizablePrimitive.PanelResizeHandle
30
95
  > {
96
+ /**
97
+ * Show a visible drag handle indicator
98
+ */
31
99
  withHandle?: boolean;
100
+ /**
101
+ * Data hook for automated testing
102
+ */
32
103
  dataHook?: string;
104
+ /**
105
+ * Tracking element identifier for analytics
106
+ */
33
107
  trackingEl?: string;
108
+ /**
109
+ * Tracking label for analytics context
110
+ */
34
111
  trackingLabel?: string;
35
112
  }
36
113
 
37
- const ResizableHandle = ({
114
+ /**
115
+ * Draggable handle between resizable panels.
116
+ */
117
+ function ResizableHandle({
38
118
  withHandle,
39
119
  className,
40
120
  dataHook,
41
121
  trackingEl,
42
122
  trackingLabel,
43
123
  ...props
44
- }: ResizableHandleProps) => (
45
- <ResizablePrimitive.PanelResizeHandle
46
- className={cn(
47
- "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
48
- className
49
- )}
50
- data-hook={dataHook}
51
- data-slot="resizable-handle"
52
- data-tracking-el={trackingEl}
53
- data-tracking-label={trackingLabel}
54
- {...props}
55
- >
56
- {withHandle && (
57
- <div className="border-border bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
58
- <GripVertical className="h-2.5 w-2.5" />
59
- </div>
60
- )}
61
- </ResizablePrimitive.PanelResizeHandle>
62
- );
124
+ }: ResizableHandleProps) {
125
+ return (
126
+ <ResizablePrimitive.PanelResizeHandle
127
+ className={cn(
128
+ "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-none data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
129
+ className
130
+ )}
131
+ data-hook={dataHook}
132
+ data-slot="resizable-handle"
133
+ data-tracking-el={trackingEl}
134
+ data-tracking-label={trackingLabel}
135
+ {...props}
136
+ >
137
+ {withHandle && (
138
+ <div className="border-border bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
139
+ <GripVertical className="h-2.5 w-2.5" />
140
+ </div>
141
+ )}
142
+ </ResizablePrimitive.PanelResizeHandle>
143
+ );
144
+ }
145
+
146
+ ResizableHandle.displayName = "ResizableHandle";
63
147
 
64
148
  export { ResizablePanelGroup, ResizablePanel, ResizableHandle };
65
149
 
66
- export type { ResizableHandleProps };
150
+ export type {
151
+ ResizablePanelGroupProps,
152
+ ResizablePanelProps,
153
+ ResizableHandleProps,
154
+ };
@@ -4,69 +4,136 @@ import * as React from "react";
4
4
  import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
5
5
  import { cn } from "@brightlocal/ui-components/lib/utils";
6
6
 
7
- type ScrollAreaProps = React.ComponentProps<typeof ScrollAreaPrimitive.Root> & {
7
+ /**
8
+ * Props for the ScrollArea component.
9
+ */
10
+ interface ScrollAreaProps extends React.ComponentProps<
11
+ typeof ScrollAreaPrimitive.Root
12
+ > {
13
+ /**
14
+ * Data hook for automated testing (required)
15
+ */
8
16
  dataHook: string;
17
+ /**
18
+ * Tracking element identifier for analytics
19
+ */
9
20
  trackingEl?: string;
21
+ /**
22
+ * Tracking label for analytics context
23
+ */
10
24
  trackingLabel?: string;
11
- };
25
+ }
12
26
 
13
- function ScrollArea({
14
- className,
15
- children,
16
- dataHook,
17
- trackingEl,
18
- trackingLabel,
19
- ...props
20
- }: ScrollAreaProps) {
21
- return (
22
- <ScrollAreaPrimitive.Root
23
- className={cn("relative", className)}
24
- data-hook={dataHook}
25
- data-slot="scroll-area"
26
- data-tracking-el={trackingEl}
27
- data-tracking-label={trackingLabel}
28
- {...props}
29
- >
30
- <ScrollAreaPrimitive.Viewport
31
- className="focus-visible:shadow-default size-full rounded-[inherit] p-1 transition-[color,box-shadow] outline-none"
32
- data-slot="scroll-area-viewport"
33
- tabIndex={0}
27
+ /**
28
+ * ScrollArea provides a styled scrollable viewport with custom scrollbars.
29
+ * Built on Radix UI ScrollArea primitive.
30
+ */
31
+ const ScrollArea = React.forwardRef<
32
+ React.ComponentRef<typeof ScrollAreaPrimitive.Root>,
33
+ ScrollAreaProps
34
+ >(
35
+ (
36
+ { className, children, dataHook, trackingEl, trackingLabel, ...props },
37
+ ref
38
+ ) => {
39
+ return (
40
+ <ScrollAreaPrimitive.Root
41
+ ref={ref}
42
+ className={cn("relative", className)}
43
+ data-hook={dataHook}
44
+ data-slot="scroll-area"
45
+ data-tracking-el={trackingEl}
46
+ data-tracking-label={trackingLabel}
47
+ {...props}
34
48
  >
35
- {children}
36
- </ScrollAreaPrimitive.Viewport>
37
- <ScrollBar />
38
- <ScrollAreaPrimitive.Corner />
39
- </ScrollAreaPrimitive.Root>
40
- );
41
- }
49
+ <ScrollAreaPrimitive.Viewport
50
+ className="focus-visible:shadow-default size-full rounded-[inherit] p-1 transition-[color,box-shadow] outline-none"
51
+ data-slot="scroll-area-viewport"
52
+ tabIndex={0}
53
+ >
54
+ {children}
55
+ </ScrollAreaPrimitive.Viewport>
56
+ <ScrollBar />
57
+ <ScrollAreaPrimitive.Corner />
58
+ </ScrollAreaPrimitive.Root>
59
+ );
60
+ }
61
+ );
42
62
 
43
- function ScrollBar({
44
- className,
45
- orientation = "vertical",
46
- ...props
47
- }: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
48
- return (
49
- <ScrollAreaPrimitive.ScrollAreaScrollbar
50
- className={cn(
51
- "flex touch-none p-px transition-colors select-none",
52
- orientation === "vertical" &&
53
- "h-full w-2.5 border-l border-l-transparent",
54
- orientation === "horizontal" &&
55
- "h-2.5 flex-col border-t border-t-transparent",
56
- className
57
- )}
58
- data-slot="scroll-area-scrollbar"
59
- orientation={orientation}
60
- {...props}
61
- >
62
- <ScrollAreaPrimitive.ScrollAreaThumb
63
- className="bg-border relative flex-1 rounded-full"
64
- data-slot="scroll-area-thumb"
65
- />
66
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
67
- );
63
+ ScrollArea.displayName = "ScrollArea";
64
+
65
+ /**
66
+ * Props for the ScrollBar component.
67
+ */
68
+ interface ScrollBarProps extends React.ComponentProps<
69
+ typeof ScrollAreaPrimitive.ScrollAreaScrollbar
70
+ > {
71
+ /**
72
+ * Data hook for automated testing
73
+ */
74
+ dataHook?: string;
75
+ /**
76
+ * Tracking element identifier for analytics
77
+ */
78
+ trackingEl?: string;
79
+ /**
80
+ * Tracking label for analytics context
81
+ */
82
+ trackingLabel?: string;
83
+ /**
84
+ * The orientation of the scrollbar
85
+ * @default "vertical"
86
+ */
87
+ orientation?: "vertical" | "horizontal";
68
88
  }
69
89
 
90
+ /**
91
+ * ScrollBar provides a styled scrollbar for ScrollArea.
92
+ */
93
+ const ScrollBar = React.forwardRef<
94
+ React.ComponentRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
95
+ ScrollBarProps
96
+ >(
97
+ (
98
+ {
99
+ className,
100
+ orientation = "vertical",
101
+ dataHook,
102
+ trackingEl,
103
+ trackingLabel,
104
+ ...props
105
+ },
106
+ ref
107
+ ) => {
108
+ return (
109
+ <ScrollAreaPrimitive.ScrollAreaScrollbar
110
+ ref={ref}
111
+ className={cn(
112
+ "flex touch-none p-px transition-colors select-none",
113
+ orientation === "vertical" &&
114
+ "h-full w-2.5 border-l border-l-transparent",
115
+ orientation === "horizontal" &&
116
+ "h-2.5 flex-col border-t border-t-transparent",
117
+ className
118
+ )}
119
+ data-hook={dataHook}
120
+ data-slot="scroll-area-scrollbar"
121
+ data-tracking-el={trackingEl}
122
+ data-tracking-label={trackingLabel}
123
+ orientation={orientation}
124
+ {...props}
125
+ >
126
+ <ScrollAreaPrimitive.ScrollAreaThumb
127
+ className="bg-border relative flex-1 rounded-full"
128
+ data-slot="scroll-area-thumb"
129
+ />
130
+ </ScrollAreaPrimitive.ScrollAreaScrollbar>
131
+ );
132
+ }
133
+ );
134
+
135
+ ScrollBar.displayName = "ScrollBar";
136
+
70
137
  export { ScrollArea, ScrollBar };
71
138
 
72
- export type { ScrollAreaProps };
139
+ export type { ScrollAreaProps, ScrollBarProps };
@@ -114,6 +114,8 @@ function Select({
114
114
  );
115
115
  }
116
116
 
117
+ Select.displayName = "Select";
118
+
117
119
  /**
118
120
  * SelectGroup - Groups related select options together
119
121
  */
@@ -123,6 +125,8 @@ function SelectGroup(
123
125
  return <SelectPrimitive.Group data-slot="select-group" {...props} />;
124
126
  }
125
127
 
128
+ SelectGroup.displayName = "SelectGroup";
129
+
126
130
  /**
127
131
  * SelectValue - Displays the selected value in the trigger
128
132
  */
@@ -132,6 +136,8 @@ function SelectValue(
132
136
  return <SelectPrimitive.Value data-slot="select-value" {...props} />;
133
137
  }
134
138
 
139
+ SelectValue.displayName = "SelectValue";
140
+
135
141
  // ============================================================================
136
142
  // Styles
137
143
  // ============================================================================
@@ -142,7 +148,7 @@ const selectTriggerVariants = cva([
142
148
  "px-3 py-2",
143
149
 
144
150
  // Base appearance
145
- "border border-border rounded-lg outline-none transition-all",
151
+ "border border-border rounded-sm outline-none transition-all",
146
152
  "bg-neutral-50 border-neutral-300",
147
153
  "dark:bg-white/5 dark:border-white/15",
148
154
 
@@ -229,6 +235,8 @@ function SelectTrigger({
229
235
  );
230
236
  }
231
237
 
238
+ SelectTrigger.displayName = "SelectTrigger";
239
+
232
240
  /**
233
241
  * SelectContent - The dropdown container for select options
234
242
  */
@@ -292,6 +300,8 @@ function SelectContent({
292
300
  );
293
301
  }
294
302
 
303
+ SelectContent.displayName = "SelectContent";
304
+
295
305
  /**
296
306
  * SelectLabel - Label for a group of select options
297
307
  */
@@ -311,6 +321,8 @@ function SelectLabel({
311
321
  );
312
322
  }
313
323
 
324
+ SelectLabel.displayName = "SelectLabel";
325
+
314
326
  /**
315
327
  * SelectItem - Individual selectable option in the dropdown
316
328
  *
@@ -368,6 +380,8 @@ function SelectItem({
368
380
  );
369
381
  }
370
382
 
383
+ SelectItem.displayName = "SelectItem";
384
+
371
385
  /**
372
386
  * SelectSeparator - Visual separator between select items or groups
373
387
  */
@@ -384,6 +398,8 @@ function SelectSeparator({
384
398
  );
385
399
  }
386
400
 
401
+ SelectSeparator.displayName = "SelectSeparator";
402
+
387
403
  /**
388
404
  * SelectScrollUpButton - Button to scroll up in the dropdown (when content overflows)
389
405
  */
@@ -405,6 +421,8 @@ function SelectScrollUpButton({
405
421
  );
406
422
  }
407
423
 
424
+ SelectScrollUpButton.displayName = "SelectScrollUpButton";
425
+
408
426
  /**
409
427
  * SelectScrollDownButton - Button to scroll down in the dropdown (when content overflows)
410
428
  */
@@ -426,6 +444,8 @@ function SelectScrollDownButton({
426
444
  );
427
445
  }
428
446
 
447
+ SelectScrollDownButton.displayName = "SelectScrollDownButton";
448
+
429
449
  export {
430
450
  Select,
431
451
  SelectContent,
@@ -10,36 +10,109 @@ export enum SeparatorOrientation {
10
10
  VERTICAL = "vertical",
11
11
  }
12
12
 
13
- function Separator({
14
- className,
15
- orientation = SeparatorOrientation.HORIZONTAL,
16
- decorative = true,
17
- ...props
18
- }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
19
- return (
20
- <SeparatorPrimitive.Root
21
- className={cn(
22
- "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
23
- className
24
- )}
25
- data-slot="separator-root"
26
- decorative={decorative}
27
- orientation={orientation}
28
- {...props}
29
- />
30
- );
13
+ /**
14
+ * Props for the Separator component.
15
+ */
16
+ interface SeparatorProps extends React.ComponentProps<
17
+ typeof SeparatorPrimitive.Root
18
+ > {
19
+ /**
20
+ * Data hook for automated testing
21
+ */
22
+ dataHook?: string;
23
+ /**
24
+ * Tracking element identifier for analytics
25
+ */
26
+ trackingEl?: string;
27
+ /**
28
+ * Tracking label for analytics context
29
+ */
30
+ trackingLabel?: string;
31
31
  }
32
32
 
33
+ /**
34
+ * Separator visually divides content using a horizontal or vertical line.
35
+ * Built on Radix UI Separator primitive.
36
+ */
37
+ const Separator = React.forwardRef<
38
+ React.ComponentRef<typeof SeparatorPrimitive.Root>,
39
+ SeparatorProps
40
+ >(
41
+ (
42
+ {
43
+ className,
44
+ orientation = SeparatorOrientation.HORIZONTAL,
45
+ decorative = true,
46
+ dataHook,
47
+ trackingEl,
48
+ trackingLabel,
49
+ ...props
50
+ },
51
+ ref
52
+ ) => {
53
+ return (
54
+ <SeparatorPrimitive.Root
55
+ ref={ref}
56
+ className={cn(
57
+ "bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
58
+ className
59
+ )}
60
+ data-hook={dataHook}
61
+ data-slot="separator"
62
+ data-tracking-el={trackingEl}
63
+ data-tracking-label={trackingLabel}
64
+ decorative={decorative}
65
+ orientation={orientation}
66
+ {...props}
67
+ />
68
+ );
69
+ }
70
+ );
71
+
72
+ Separator.displayName = "Separator";
73
+
74
+ /**
75
+ * Props for the SeparatorWithText component.
76
+ */
33
77
  interface SeparatorWithTextProps {
78
+ /**
79
+ * Additional CSS classes
80
+ */
34
81
  className?: string;
82
+ /**
83
+ * Text content to display between separators
84
+ */
35
85
  children: React.ReactNode;
86
+ /**
87
+ * Data hook for automated testing
88
+ */
89
+ dataHook?: string;
90
+ /**
91
+ * Tracking element identifier for analytics
92
+ */
93
+ trackingEl?: string;
94
+ /**
95
+ * Tracking label for analytics context
96
+ */
97
+ trackingLabel?: string;
36
98
  }
37
99
 
38
- function SeparatorWithText({ className, children }: SeparatorWithTextProps) {
100
+ /**
101
+ * SeparatorWithText displays a horizontal separator with centered text.
102
+ * Commonly used for "OR" dividers in forms.
103
+ */
104
+ const SeparatorWithText = React.forwardRef<
105
+ HTMLDivElement,
106
+ SeparatorWithTextProps
107
+ >(({ className, children, dataHook, trackingEl, trackingLabel }, ref) => {
39
108
  return (
40
109
  <div
110
+ ref={ref}
41
111
  className={cn("flex items-center gap-2", className)}
112
+ data-hook={dataHook}
42
113
  data-slot="separator-with-text"
114
+ data-tracking-el={trackingEl}
115
+ data-tracking-label={trackingLabel}
43
116
  >
44
117
  <Separator className="flex-1" />
45
118
  <span className="text-sidebar-foreground shrink-0 text-sm leading-none font-medium whitespace-nowrap">
@@ -48,6 +121,10 @@ function SeparatorWithText({ className, children }: SeparatorWithTextProps) {
48
121
  <Separator className="flex-1" />
49
122
  </div>
50
123
  );
51
- }
124
+ });
125
+
126
+ SeparatorWithText.displayName = "SeparatorWithText";
52
127
 
53
128
  export { Separator, SeparatorWithText };
129
+
130
+ export type { SeparatorProps, SeparatorWithTextProps };