@brightlocal/ui-components 0.1.1 → 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.
- package/dist/accordion.cjs +1 -1
- package/dist/accordion.d.ts +74 -4
- package/dist/accordion.d.ts.map +1 -1
- package/dist/accordion.js +100 -105
- package/dist/alert-dialog.cjs +1 -1
- package/dist/alert-dialog.d.ts +30 -10
- package/dist/alert-dialog.d.ts.map +1 -1
- package/dist/alert-dialog.js +129 -132
- package/dist/alert.d.ts +22 -1
- package/dist/alert.d.ts.map +1 -1
- package/dist/aspect-ratio.cjs +1 -1
- package/dist/aspect-ratio.d.ts +11 -1
- package/dist/aspect-ratio.d.ts.map +1 -1
- package/dist/aspect-ratio.js +16 -20
- package/dist/avatar.cjs +1 -1
- package/dist/avatar.d.ts +43 -3
- package/dist/avatar.d.ts.map +1 -1
- package/dist/avatar.js +18 -16
- package/dist/badge.cjs +1 -1
- package/dist/badge.d.ts +24 -9
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.js +34 -32
- package/dist/blocks/data-table.cjs +1 -1
- package/dist/blocks/data-table.d.ts.map +1 -1
- package/dist/blocks/data-table.js +209 -202
- package/dist/blocks/sidebar.cjs +1 -1
- package/dist/blocks/sidebar.d.ts +1 -1
- package/dist/blocks/sidebar.d.ts.map +1 -1
- package/dist/blocks/sidebar.js +154 -154
- package/dist/breadcrumb.cjs +1 -1
- package/dist/breadcrumb.d.ts +63 -8
- package/dist/breadcrumb.d.ts.map +1 -1
- package/dist/breadcrumb.js +97 -93
- package/dist/button.cjs +1 -1
- package/dist/button.d.ts +17 -45
- package/dist/button.d.ts.map +1 -1
- package/dist/button.js +49 -50
- package/dist/calendar.cjs +1 -1
- package/dist/calendar.d.ts +12 -0
- package/dist/calendar.d.ts.map +1 -1
- package/dist/calendar.js +10 -8
- package/dist/card.cjs +1 -1
- package/dist/card.d.ts +58 -18
- package/dist/card.d.ts.map +1 -1
- package/dist/card.js +60 -51
- package/dist/carousel.cjs +1 -1
- package/dist/carousel.d.ts +99 -9
- package/dist/carousel.d.ts.map +1 -1
- package/dist/carousel.js +142 -128
- package/dist/centred-layout.cjs +1 -1
- package/dist/centred-layout.d.ts +18 -2
- package/dist/centred-layout.d.ts.map +1 -1
- package/dist/centred-layout.js +46 -33
- package/dist/chart.cjs +4 -4
- package/dist/chart.d.ts +70 -7
- package/dist/chart.d.ts.map +1 -1
- package/dist/chart.js +71 -66
- package/dist/checkbox.cjs +1 -1
- package/dist/checkbox.d.ts +9 -5
- package/dist/checkbox.d.ts.map +1 -1
- package/dist/checkbox.js +61 -82
- package/dist/collapsible.cjs +1 -1
- package/dist/collapsible.d.ts +65 -8
- package/dist/collapsible.d.ts.map +1 -1
- package/dist/collapsible.js +41 -55
- package/dist/combobox.cjs +1 -1
- package/dist/combobox.d.ts +29 -11
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +193 -159
- package/dist/command.cjs +1 -1
- package/dist/command.d.ts +115 -9
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +176 -152
- package/dist/context-menu.cjs +1 -1
- package/dist/context-menu.d.ts +188 -20
- package/dist/context-menu.d.ts.map +1 -1
- package/dist/context-menu.js +119 -121
- package/dist/date-picker.cjs +1 -1
- package/dist/date-picker.d.ts +75 -9
- package/dist/date-picker.d.ts.map +1 -1
- package/dist/date-picker.js +220 -81
- package/dist/description.cjs +1 -0
- package/dist/description.d.ts +37 -0
- package/dist/description.d.ts.map +1 -0
- package/dist/description.js +25 -0
- package/dist/dialog.cjs +1 -1
- package/dist/dialog.d.ts +73 -9
- package/dist/dialog.d.ts.map +1 -1
- package/dist/dialog.js +103 -112
- package/dist/drawer.cjs +1 -1
- package/dist/drawer.d.ts +92 -0
- package/dist/drawer.d.ts.map +1 -1
- package/dist/drawer.js +67 -52
- package/dist/dropdown-menu.cjs +1 -1
- package/dist/dropdown-menu.d.ts +95 -11
- package/dist/dropdown-menu.d.ts.map +1 -1
- package/dist/dropdown-menu.js +146 -106
- package/dist/field.cjs +1 -1
- package/dist/field.d.ts +23 -6
- package/dist/field.d.ts.map +1 -1
- package/dist/field.js +54 -53
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts +27 -17
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +86 -79
- package/dist/hover-card.cjs +1 -1
- package/dist/hover-card.d.ts +36 -6
- package/dist/hover-card.d.ts.map +1 -1
- package/dist/hover-card.js +44 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +383 -387
- package/dist/input-group.cjs +1 -1
- package/dist/input-group.d.ts +21 -2
- package/dist/input-group.d.ts.map +1 -1
- package/dist/input-group.js +51 -41
- package/dist/input-password.cjs +1 -1
- package/dist/input-password.d.ts.map +1 -1
- package/dist/input-password.js +24 -25
- package/dist/input.cjs +1 -1
- package/dist/input.d.ts +38 -24
- package/dist/input.d.ts.map +1 -1
- package/dist/input.js +68 -136
- package/dist/label.cjs +1 -1
- package/dist/label.d.ts +20 -1
- package/dist/label.d.ts.map +1 -1
- package/dist/label.js +31 -18
- package/dist/logo.cjs +1 -1
- package/dist/logo.d.ts +3 -0
- package/dist/logo.d.ts.map +1 -1
- package/dist/logo.js +12 -10
- package/dist/menubar.cjs +1 -1
- package/dist/menubar.d.ts +40 -6
- package/dist/menubar.d.ts.map +1 -1
- package/dist/menubar.js +97 -76
- package/dist/popover.cjs +1 -1
- package/dist/popover.d.ts +59 -4
- package/dist/popover.d.ts.map +1 -1
- package/dist/popover.js +42 -34
- package/dist/progress.cjs +1 -1
- package/dist/progress.d.ts +9 -2
- package/dist/progress.d.ts.map +1 -1
- package/dist/progress.js +71 -59
- package/dist/radio-group.d.ts +40 -0
- package/dist/radio-group.d.ts.map +1 -1
- package/dist/rating.d.ts +4 -0
- package/dist/rating.d.ts.map +1 -1
- package/dist/resizable.cjs +1 -1
- package/dist/resizable.d.ts +65 -4
- package/dist/resizable.d.ts.map +1 -1
- package/dist/resizable.js +53 -36
- package/dist/scroll-area.cjs +1 -1
- package/dist/scroll-area.d.ts +46 -5
- package/dist/scroll-area.d.ts.map +1 -1
- package/dist/scroll-area.js +42 -38
- package/dist/select.cjs +1 -1
- package/dist/select.d.ts +30 -0
- package/dist/select.d.ts.map +1 -1
- package/dist/select.js +64 -54
- package/dist/separator.cjs +1 -1
- package/dist/separator.d.ts +49 -2
- package/dist/separator.d.ts.map +1 -1
- package/dist/separator.js +48 -36
- package/dist/sheet.cjs +1 -1
- package/dist/sheet.d.ts +80 -9
- package/dist/sheet.d.ts.map +1 -1
- package/dist/sheet.js +117 -113
- package/dist/skeleton.cjs +1 -1
- package/dist/skeleton.d.ts +24 -2
- package/dist/skeleton.d.ts.map +1 -1
- package/dist/skeleton.js +15 -9
- package/dist/slider.cjs +1 -1
- package/dist/slider.d.ts +18 -4
- package/dist/slider.d.ts.map +1 -1
- package/dist/slider.js +72 -66
- package/dist/sonner.cjs +1 -1
- package/dist/sonner.d.ts +4 -2
- package/dist/sonner.d.ts.map +1 -1
- package/dist/sonner.js +29 -28
- package/dist/split-layout.d.ts +4 -1
- package/dist/split-layout.d.ts.map +1 -1
- package/dist/table.cjs +1 -1
- package/dist/table.js +1 -1
- package/dist/toggle-group.cjs +1 -1
- package/dist/toggle-group.d.ts +3 -1
- package/dist/toggle-group.d.ts.map +1 -1
- package/dist/toggle-group.js +38 -36
- package/package.json +8 -2
- package/src/blocks/data-table.tsx +42 -32
- package/src/blocks/sidebar.tsx +4 -12
- package/src/components/accordion.tsx +163 -77
- package/src/components/alert-dialog.tsx +156 -111
- package/src/components/alert.tsx +26 -13
- package/src/components/aspect-ratio.tsx +25 -16
- package/src/components/avatar.tsx +56 -8
- package/src/components/badge.tsx +65 -42
- package/src/components/breadcrumb.tsx +158 -82
- package/src/components/button.tsx +41 -62
- package/src/components/calendar.tsx +16 -2
- package/src/components/card.tsx +92 -40
- package/src/components/carousel.tsx +240 -115
- package/src/components/centred-layout.tsx +67 -35
- package/src/components/chart.tsx +118 -47
- package/src/components/checkbox.tsx +42 -78
- package/src/components/collapsible.tsx +95 -26
- package/src/components/combobox.tsx +242 -144
- package/src/components/command.tsx +295 -121
- package/src/components/context-menu.tsx +278 -81
- package/src/components/date-picker.tsx +281 -30
- package/src/components/description.tsx +60 -0
- package/src/components/dialog.tsx +162 -86
- package/src/components/drawer.tsx +76 -2
- package/src/components/dropdown-menu.tsx +143 -37
- package/src/components/field.tsx +36 -11
- package/src/components/global-layout.tsx +116 -77
- package/src/components/hover-card.tsx +54 -14
- package/src/components/input-group.tsx +56 -18
- package/src/components/input-password.tsx +3 -4
- package/src/components/input.tsx +93 -186
- package/src/components/label.tsx +56 -15
- package/src/components/logo.tsx +3 -0
- package/src/components/menubar.tsx +58 -4
- package/src/components/popover.tsx +103 -20
- package/src/components/progress.tsx +82 -60
- package/src/components/radio-group.tsx +40 -0
- package/src/components/rating.tsx +4 -1
- package/src/components/resizable.tsx +119 -31
- package/src/components/scroll-area.tsx +123 -56
- package/src/components/select.tsx +21 -1
- package/src/components/separator.tsx +97 -20
- package/src/components/sheet.tsx +180 -79
- package/src/components/skeleton.tsx +40 -10
- package/src/components/slider.tsx +83 -57
- package/src/components/sonner.tsx +10 -7
- package/src/components/split-layout.tsx +4 -1
- package/src/components/table.tsx +1 -1
- package/src/components/toggle-group.tsx +4 -0
- package/src/index.ts +1 -1
- package/dist/input-base.cjs +0 -1
- package/dist/input-base.d.ts +0 -28
- package/dist/input-base.d.ts.map +0 -1
- package/dist/input-base.js +0 -56
- 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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
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
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
data-
|
|
33
|
-
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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-
|
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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
|
-
|
|
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 };
|