@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
package/src/components/sheet.tsx
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import * as SheetPrimitive from "@radix-ui/react-dialog";
|
|
3
5
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
@@ -83,66 +85,142 @@ const sheetContentVariants = cva(
|
|
|
83
85
|
}
|
|
84
86
|
);
|
|
85
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Sheet root component that provides context for the sheet dialog.
|
|
90
|
+
* Wraps the Radix UI Dialog primitive with modal behavior enabled by default.
|
|
91
|
+
*/
|
|
86
92
|
function Sheet({ ...props }: React.ComponentProps<typeof SheetPrimitive.Root>) {
|
|
87
93
|
return <SheetPrimitive.Root data-slot="sheet" modal={true} {...props} />;
|
|
88
94
|
}
|
|
95
|
+
Sheet.displayName = "Sheet";
|
|
89
96
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Props for SheetTrigger component
|
|
99
|
+
*/
|
|
100
|
+
interface SheetTriggerProps extends React.ComponentProps<
|
|
101
|
+
typeof SheetPrimitive.Trigger
|
|
102
|
+
> {
|
|
103
|
+
/**
|
|
104
|
+
* Data hook for automated testing
|
|
105
|
+
*/
|
|
106
|
+
dataHook?: string;
|
|
94
107
|
}
|
|
95
108
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
109
|
+
/**
|
|
110
|
+
* Sheet trigger button that opens the sheet when clicked.
|
|
111
|
+
* Use with asChild prop to merge with your own button component.
|
|
112
|
+
*/
|
|
113
|
+
const SheetTrigger = React.forwardRef<
|
|
114
|
+
React.ComponentRef<typeof SheetPrimitive.Trigger>,
|
|
115
|
+
SheetTriggerProps
|
|
116
|
+
>(({ dataHook, ...props }, ref) => (
|
|
117
|
+
<SheetPrimitive.Trigger
|
|
118
|
+
ref={ref}
|
|
119
|
+
data-hook={dataHook}
|
|
120
|
+
data-slot="sheet-trigger"
|
|
121
|
+
{...props}
|
|
122
|
+
/>
|
|
123
|
+
));
|
|
124
|
+
SheetTrigger.displayName = "SheetTrigger";
|
|
101
125
|
|
|
126
|
+
/**
|
|
127
|
+
* Sheet close button that closes the sheet when clicked.
|
|
128
|
+
* Use with asChild prop to merge with your own button component.
|
|
129
|
+
*/
|
|
130
|
+
const SheetClose = React.forwardRef<
|
|
131
|
+
React.ComponentRef<typeof SheetPrimitive.Close>,
|
|
132
|
+
React.ComponentProps<typeof SheetPrimitive.Close>
|
|
133
|
+
>(({ ...props }, ref) => (
|
|
134
|
+
<SheetPrimitive.Close ref={ref} data-slot="sheet-close" {...props} />
|
|
135
|
+
));
|
|
136
|
+
SheetClose.displayName = "SheetClose";
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Sheet portal that renders content in a React portal.
|
|
140
|
+
* Used internally by SheetContent.
|
|
141
|
+
*/
|
|
102
142
|
function SheetPortal({
|
|
103
143
|
...props
|
|
104
144
|
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
105
145
|
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />;
|
|
106
146
|
}
|
|
147
|
+
SheetPortal.displayName = "SheetPortal";
|
|
107
148
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
149
|
+
/**
|
|
150
|
+
* Sheet overlay that appears behind the sheet content.
|
|
151
|
+
* Provides a semi-transparent backdrop with fade animation.
|
|
152
|
+
*/
|
|
153
|
+
const SheetOverlay = React.forwardRef<
|
|
154
|
+
React.ComponentRef<typeof SheetPrimitive.Overlay>,
|
|
155
|
+
React.ComponentProps<typeof SheetPrimitive.Overlay>
|
|
156
|
+
>(({ className, ...props }, ref) => (
|
|
157
|
+
<SheetPrimitive.Overlay
|
|
158
|
+
ref={ref}
|
|
159
|
+
className={cn(
|
|
160
|
+
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
161
|
+
className
|
|
162
|
+
)}
|
|
163
|
+
data-slot="sheet-overlay"
|
|
164
|
+
{...props}
|
|
165
|
+
/>
|
|
166
|
+
));
|
|
167
|
+
SheetOverlay.displayName = "SheetOverlay";
|
|
123
168
|
|
|
169
|
+
/**
|
|
170
|
+
* Props for the SheetContent component
|
|
171
|
+
*/
|
|
124
172
|
interface SheetContentProps
|
|
125
173
|
extends
|
|
126
174
|
React.ComponentProps<typeof SheetPrimitive.Content>,
|
|
127
175
|
VariantProps<typeof sheetContentVariants> {
|
|
128
176
|
/**
|
|
129
177
|
* Side from which the sheet slides in
|
|
178
|
+
* @default "right"
|
|
130
179
|
*/
|
|
131
180
|
side?: SheetSide;
|
|
181
|
+
/**
|
|
182
|
+
* Data hook for automated testing
|
|
183
|
+
*/
|
|
184
|
+
dataHook?: string;
|
|
185
|
+
/**
|
|
186
|
+
* Tracking element identifier for analytics
|
|
187
|
+
*/
|
|
188
|
+
trackingEl?: string;
|
|
189
|
+
/**
|
|
190
|
+
* Tracking label for analytics context
|
|
191
|
+
*/
|
|
192
|
+
trackingLabel?: string;
|
|
132
193
|
}
|
|
133
194
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
195
|
+
/**
|
|
196
|
+
* Sheet content container that slides in from the specified side.
|
|
197
|
+
* Includes an overlay backdrop and close button.
|
|
198
|
+
*/
|
|
199
|
+
const SheetContent = React.forwardRef<
|
|
200
|
+
React.ComponentRef<typeof SheetPrimitive.Content>,
|
|
201
|
+
SheetContentProps
|
|
202
|
+
>(
|
|
203
|
+
(
|
|
204
|
+
{
|
|
205
|
+
className,
|
|
206
|
+
children,
|
|
207
|
+
side,
|
|
208
|
+
dataHook,
|
|
209
|
+
trackingEl,
|
|
210
|
+
trackingLabel,
|
|
211
|
+
...props
|
|
212
|
+
},
|
|
213
|
+
ref
|
|
214
|
+
) => (
|
|
141
215
|
<SheetPortal>
|
|
142
216
|
<SheetOverlay />
|
|
143
217
|
<SheetPrimitive.Content
|
|
218
|
+
ref={ref}
|
|
144
219
|
className={cn(sheetContentVariants({ side }), className)}
|
|
220
|
+
data-hook={dataHook}
|
|
145
221
|
data-slot="sheet-content"
|
|
222
|
+
data-tracking-el={trackingEl}
|
|
223
|
+
data-tracking-label={trackingLabel}
|
|
146
224
|
{...props}
|
|
147
225
|
>
|
|
148
226
|
{children}
|
|
@@ -152,57 +230,80 @@ function SheetContent({
|
|
|
152
230
|
</SheetPrimitive.Close>
|
|
153
231
|
</SheetPrimitive.Content>
|
|
154
232
|
</SheetPortal>
|
|
155
|
-
)
|
|
156
|
-
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
SheetContent.displayName = "SheetContent";
|
|
157
236
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
237
|
+
/**
|
|
238
|
+
* Sheet header section for title and description.
|
|
239
|
+
* Centers text on mobile, left-aligns on larger screens.
|
|
240
|
+
*/
|
|
241
|
+
const SheetHeader = React.forwardRef<
|
|
242
|
+
HTMLDivElement,
|
|
243
|
+
React.ComponentProps<"div">
|
|
244
|
+
>(({ className, ...props }, ref) => (
|
|
245
|
+
<div
|
|
246
|
+
ref={ref}
|
|
247
|
+
className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
|
|
248
|
+
data-slot="sheet-header"
|
|
249
|
+
{...props}
|
|
250
|
+
/>
|
|
251
|
+
));
|
|
252
|
+
SheetHeader.displayName = "SheetHeader";
|
|
167
253
|
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
254
|
+
/**
|
|
255
|
+
* Sheet footer section for actions and buttons.
|
|
256
|
+
* Stacks buttons on mobile, aligns to end on larger screens.
|
|
257
|
+
*/
|
|
258
|
+
const SheetFooter = React.forwardRef<
|
|
259
|
+
HTMLDivElement,
|
|
260
|
+
React.ComponentProps<"div">
|
|
261
|
+
>(({ className, ...props }, ref) => (
|
|
262
|
+
<div
|
|
263
|
+
ref={ref}
|
|
264
|
+
className={cn(
|
|
265
|
+
"mt-auto flex flex-col gap-2 sm:flex-row sm:justify-end",
|
|
266
|
+
className
|
|
267
|
+
)}
|
|
268
|
+
data-slot="sheet-footer"
|
|
269
|
+
{...props}
|
|
270
|
+
/>
|
|
271
|
+
));
|
|
272
|
+
SheetFooter.displayName = "SheetFooter";
|
|
180
273
|
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Sheet title component for the main heading.
|
|
276
|
+
* Should be used within SheetHeader.
|
|
277
|
+
*/
|
|
278
|
+
const SheetTitle = React.forwardRef<
|
|
279
|
+
React.ComponentRef<typeof SheetPrimitive.Title>,
|
|
280
|
+
React.ComponentProps<typeof SheetPrimitive.Title>
|
|
281
|
+
>(({ className, ...props }, ref) => (
|
|
282
|
+
<SheetPrimitive.Title
|
|
283
|
+
ref={ref}
|
|
284
|
+
className={cn("text-foreground text-lg font-semibold", className)}
|
|
285
|
+
data-slot="sheet-title"
|
|
286
|
+
{...props}
|
|
287
|
+
/>
|
|
288
|
+
));
|
|
289
|
+
SheetTitle.displayName = "SheetTitle";
|
|
193
290
|
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
291
|
+
/**
|
|
292
|
+
* Sheet description component for additional context.
|
|
293
|
+
* Should be used within SheetHeader below SheetTitle.
|
|
294
|
+
*/
|
|
295
|
+
const SheetDescription = React.forwardRef<
|
|
296
|
+
React.ComponentRef<typeof SheetPrimitive.Description>,
|
|
297
|
+
React.ComponentProps<typeof SheetPrimitive.Description>
|
|
298
|
+
>(({ className, ...props }, ref) => (
|
|
299
|
+
<SheetPrimitive.Description
|
|
300
|
+
ref={ref}
|
|
301
|
+
className={cn("text-muted-foreground text-sm", className)}
|
|
302
|
+
data-slot="sheet-description"
|
|
303
|
+
{...props}
|
|
304
|
+
/>
|
|
305
|
+
));
|
|
306
|
+
SheetDescription.displayName = "SheetDescription";
|
|
206
307
|
|
|
207
308
|
export {
|
|
208
309
|
Sheet,
|
|
@@ -217,4 +318,4 @@ export {
|
|
|
217
318
|
SheetTrigger,
|
|
218
319
|
};
|
|
219
320
|
|
|
220
|
-
export type { SheetContentProps };
|
|
321
|
+
export type { SheetContentProps, SheetTriggerProps };
|
|
@@ -1,17 +1,47 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as React from "react";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Props for the Skeleton component
|
|
7
|
+
*/
|
|
8
|
+
interface SkeletonProps extends React.ComponentProps<"div"> {
|
|
9
|
+
/**
|
|
10
|
+
* Data hook for automated testing (optional for Skeleton as it's purely presentational)
|
|
11
|
+
*/
|
|
12
|
+
dataHook?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Tracking element identifier for analytics
|
|
15
|
+
*/
|
|
16
|
+
trackingEl?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Tracking label for analytics context
|
|
19
|
+
*/
|
|
20
|
+
trackingLabel?: string;
|
|
13
21
|
}
|
|
14
22
|
|
|
23
|
+
/**
|
|
24
|
+
* Skeleton component for loading placeholder states.
|
|
25
|
+
* Displays a pulsing animation to indicate content is loading.
|
|
26
|
+
* Use to represent text, images, avatars, or any other content while data is being fetched.
|
|
27
|
+
*/
|
|
28
|
+
const Skeleton = React.forwardRef<HTMLDivElement, SkeletonProps>(
|
|
29
|
+
({ className, dataHook, trackingEl, trackingLabel, ...props }, ref) => {
|
|
30
|
+
return (
|
|
31
|
+
<div
|
|
32
|
+
ref={ref}
|
|
33
|
+
className={cn("bg-accent animate-pulse rounded-md", className)}
|
|
34
|
+
data-hook={dataHook}
|
|
35
|
+
data-slot="skeleton"
|
|
36
|
+
data-tracking-el={trackingEl}
|
|
37
|
+
data-tracking-label={trackingLabel}
|
|
38
|
+
{...props}
|
|
39
|
+
/>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
Skeleton.displayName = "Skeleton";
|
|
44
|
+
|
|
15
45
|
export { Skeleton };
|
|
16
46
|
|
|
17
47
|
export type { SkeletonProps };
|
|
@@ -5,82 +5,108 @@ import * as SliderPrimitive from "@radix-ui/react-slider";
|
|
|
5
5
|
|
|
6
6
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
7
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Props for the Slider component
|
|
10
|
+
*/
|
|
8
11
|
export interface SliderProps extends React.ComponentProps<
|
|
9
12
|
typeof SliderPrimitive.Root
|
|
10
13
|
> {
|
|
11
14
|
/**
|
|
12
|
-
*
|
|
15
|
+
* Data hook for automated testing (required)
|
|
13
16
|
*/
|
|
14
17
|
dataHook: string;
|
|
15
18
|
/**
|
|
16
|
-
*
|
|
19
|
+
* Accessible labels for the slider thumb(s).
|
|
20
|
+
* For range sliders with multiple thumbs, provide an array of labels.
|
|
21
|
+
* @default ["Slider"]
|
|
22
|
+
*/
|
|
23
|
+
thumbLabels?: string[];
|
|
24
|
+
/**
|
|
25
|
+
* Tracking element identifier for analytics
|
|
17
26
|
*/
|
|
18
27
|
trackingEl?: string;
|
|
19
28
|
/**
|
|
20
|
-
*
|
|
29
|
+
* Tracking label for analytics context
|
|
21
30
|
*/
|
|
22
31
|
trackingLabel?: string;
|
|
23
32
|
}
|
|
24
33
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
/**
|
|
35
|
+
* Slider component for selecting numeric values within a range.
|
|
36
|
+
* Supports single value selection and range selection (two thumbs).
|
|
37
|
+
* Built on Radix UI Slider primitive with full keyboard accessibility.
|
|
38
|
+
*/
|
|
39
|
+
const Slider = React.forwardRef<
|
|
40
|
+
React.ComponentRef<typeof SliderPrimitive.Root>,
|
|
41
|
+
SliderProps
|
|
42
|
+
>(
|
|
43
|
+
(
|
|
44
|
+
{
|
|
45
|
+
className,
|
|
46
|
+
dataHook,
|
|
47
|
+
defaultValue,
|
|
48
|
+
max = 100,
|
|
49
|
+
min = 0,
|
|
50
|
+
thumbLabels,
|
|
51
|
+
trackingEl,
|
|
52
|
+
trackingLabel,
|
|
53
|
+
value,
|
|
54
|
+
...props
|
|
55
|
+
},
|
|
56
|
+
ref
|
|
57
|
+
) => {
|
|
58
|
+
const _values = React.useMemo(
|
|
59
|
+
() =>
|
|
60
|
+
Array.isArray(value)
|
|
61
|
+
? value
|
|
62
|
+
: Array.isArray(defaultValue)
|
|
63
|
+
? defaultValue
|
|
64
|
+
: [min, max],
|
|
65
|
+
[value, defaultValue, min, max]
|
|
66
|
+
);
|
|
45
67
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
50
|
-
className
|
|
51
|
-
)}
|
|
52
|
-
data-hook={dataHook}
|
|
53
|
-
data-slot="slider"
|
|
54
|
-
data-tracking-el={trackingEl}
|
|
55
|
-
data-tracking-label={trackingLabel}
|
|
56
|
-
defaultValue={defaultValue}
|
|
57
|
-
max={max}
|
|
58
|
-
min={min}
|
|
59
|
-
value={value}
|
|
60
|
-
{...props}
|
|
61
|
-
>
|
|
62
|
-
<SliderPrimitive.Track
|
|
68
|
+
return (
|
|
69
|
+
<SliderPrimitive.Root
|
|
70
|
+
ref={ref}
|
|
63
71
|
className={cn(
|
|
64
|
-
"
|
|
72
|
+
"relative flex w-full touch-none items-center select-none data-[disabled]:opacity-50 data-[orientation=vertical]:h-full data-[orientation=vertical]:min-h-44 data-[orientation=vertical]:w-auto data-[orientation=vertical]:flex-col",
|
|
73
|
+
className
|
|
65
74
|
)}
|
|
66
|
-
data-
|
|
75
|
+
data-hook={dataHook}
|
|
76
|
+
data-slot="slider"
|
|
77
|
+
data-tracking-el={trackingEl}
|
|
78
|
+
data-tracking-label={trackingLabel}
|
|
79
|
+
defaultValue={defaultValue}
|
|
80
|
+
max={max}
|
|
81
|
+
min={min}
|
|
82
|
+
value={value}
|
|
83
|
+
{...props}
|
|
67
84
|
>
|
|
68
|
-
<SliderPrimitive.
|
|
85
|
+
<SliderPrimitive.Track
|
|
69
86
|
className={cn(
|
|
70
|
-
"bg-
|
|
87
|
+
"bg-muted relative grow overflow-hidden rounded-full data-[orientation=horizontal]:h-1.5 data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-1.5"
|
|
71
88
|
)}
|
|
72
|
-
data-slot="slider-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}
|
|
89
|
+
data-slot="slider-track"
|
|
90
|
+
>
|
|
91
|
+
<SliderPrimitive.Range
|
|
92
|
+
className={cn(
|
|
93
|
+
"bg-primary absolute data-[orientation=horizontal]:h-full data-[orientation=vertical]:w-full"
|
|
94
|
+
)}
|
|
95
|
+
data-slot="slider-range"
|
|
96
|
+
/>
|
|
97
|
+
</SliderPrimitive.Track>
|
|
98
|
+
{Array.from({ length: _values.length }, (_, index) => (
|
|
99
|
+
<SliderPrimitive.Thumb
|
|
100
|
+
key={index}
|
|
101
|
+
aria-label={thumbLabels?.[index] ?? "Slider"}
|
|
102
|
+
className="border-primary bg-background ring-ring/50 block size-4 shrink-0 rounded-full border shadow-sm transition-[color,box-shadow] hover:ring-4 focus-visible:ring-4 focus-visible:outline-hidden disabled:pointer-events-none disabled:opacity-50"
|
|
103
|
+
data-slot="slider-thumb"
|
|
104
|
+
/>
|
|
105
|
+
))}
|
|
106
|
+
</SliderPrimitive.Root>
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
);
|
|
110
|
+
Slider.displayName = "Slider";
|
|
85
111
|
|
|
86
112
|
export { Slider };
|
|
@@ -10,11 +10,7 @@ import {
|
|
|
10
10
|
import { cva } from "class-variance-authority";
|
|
11
11
|
import { toast as sonnerToast, Toaster as SonnerToaster } from "sonner";
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
Button,
|
|
15
|
-
ButtonVariant,
|
|
16
|
-
ButtonSize,
|
|
17
|
-
} from "@brightlocal/ui-components/button";
|
|
13
|
+
import { Button } from "@brightlocal/ui-components/button";
|
|
18
14
|
import { cn } from "@brightlocal/ui-components/lib/utils";
|
|
19
15
|
|
|
20
16
|
/**
|
|
@@ -36,7 +32,13 @@ type ToastProps = {
|
|
|
36
32
|
/** Click handler for the button */
|
|
37
33
|
onClick?: () => void;
|
|
38
34
|
/** Visual variant of the button */
|
|
39
|
-
variant?:
|
|
35
|
+
variant?:
|
|
36
|
+
| "default"
|
|
37
|
+
| "destructive"
|
|
38
|
+
| "outline"
|
|
39
|
+
| "secondary"
|
|
40
|
+
| "ghost"
|
|
41
|
+
| "warning";
|
|
40
42
|
};
|
|
41
43
|
/** Color theme for the toast */
|
|
42
44
|
colorSchema?: SonnerColorSchema;
|
|
@@ -243,7 +245,7 @@ function Toast(props: ToastProps) {
|
|
|
243
245
|
aria-label={button.label}
|
|
244
246
|
className="min-h-6 px-2 py-0 text-xs leading-normal font-medium"
|
|
245
247
|
dataHook="toast-action"
|
|
246
|
-
size=
|
|
248
|
+
size="default"
|
|
247
249
|
variant={button.variant}
|
|
248
250
|
onClick={button.onClick}
|
|
249
251
|
>
|
|
@@ -324,6 +326,7 @@ function Toast(props: ToastProps) {
|
|
|
324
326
|
function Sonner() {
|
|
325
327
|
return <SonnerToaster position="top-right" />;
|
|
326
328
|
}
|
|
329
|
+
Sonner.displayName = "Sonner";
|
|
327
330
|
|
|
328
331
|
/**
|
|
329
332
|
* @module Sonner
|
|
@@ -120,7 +120,10 @@ const SplitLayout = React.forwardRef<HTMLDivElement, SplitLayoutProps>(
|
|
|
120
120
|
SplitLayout.displayName = "SplitLayout";
|
|
121
121
|
|
|
122
122
|
interface SplitLayoutSectionProps extends React.ComponentProps<"div"> {
|
|
123
|
-
/**
|
|
123
|
+
/**
|
|
124
|
+
* Which side this section appears on: "left" | "right"
|
|
125
|
+
* @default "left"
|
|
126
|
+
*/
|
|
124
127
|
side?: "left" | "right";
|
|
125
128
|
}
|
|
126
129
|
|
package/src/components/table.tsx
CHANGED
|
@@ -37,7 +37,7 @@ const tableCellVariants = cva(
|
|
|
37
37
|
);
|
|
38
38
|
|
|
39
39
|
const tableHeadVariants = cva(
|
|
40
|
-
"h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted
|
|
40
|
+
"h-10 p-2 border-b align-middle text-muted-foreground text-sm font-medium leading-normal hover:bg-muted break-words",
|
|
41
41
|
{
|
|
42
42
|
variants: {
|
|
43
43
|
align: {
|
|
@@ -66,6 +66,8 @@ type ToggleGroupItemProps = {
|
|
|
66
66
|
trackingEl?: string;
|
|
67
67
|
/** Tracking label for analytics context */
|
|
68
68
|
trackingLabel?: string;
|
|
69
|
+
/** ARIA label for accessibility (required when no text content) */
|
|
70
|
+
ariaLabel?: string;
|
|
69
71
|
} & React.ComponentProps<typeof ToggleGroupPrimitive.Item> &
|
|
70
72
|
VariantProps<typeof toggleVariants>;
|
|
71
73
|
|
|
@@ -77,12 +79,14 @@ function ToggleGroupItem({
|
|
|
77
79
|
dataHook,
|
|
78
80
|
trackingEl,
|
|
79
81
|
trackingLabel,
|
|
82
|
+
ariaLabel,
|
|
80
83
|
...props
|
|
81
84
|
}: ToggleGroupItemProps) {
|
|
82
85
|
const context = React.useContext(ToggleGroupContext);
|
|
83
86
|
|
|
84
87
|
return (
|
|
85
88
|
<ToggleGroupPrimitive.Item
|
|
89
|
+
aria-label={ariaLabel}
|
|
86
90
|
className={cn(
|
|
87
91
|
toggleVariants({
|
|
88
92
|
variant: context.variant || variant,
|
package/src/index.ts
CHANGED
|
@@ -18,6 +18,7 @@ export * from "./components/combobox";
|
|
|
18
18
|
export * from "./components/command";
|
|
19
19
|
export * from "./components/date-picker";
|
|
20
20
|
export * from "./components/context-menu";
|
|
21
|
+
export * from "./components/description";
|
|
21
22
|
export * from "./components/dialog";
|
|
22
23
|
export * from "./components/drawer";
|
|
23
24
|
export * from "./components/dropdown-menu";
|
|
@@ -25,7 +26,6 @@ export * from "./components/field";
|
|
|
25
26
|
export * from "./components/global-layout";
|
|
26
27
|
export * from "./components/hover-card";
|
|
27
28
|
export * from "./components/input";
|
|
28
|
-
export * from "./components/input-base";
|
|
29
29
|
export * from "./components/input-group";
|
|
30
30
|
export * from "./components/input-otp";
|
|
31
31
|
export * from "./components/label";
|
package/dist/input-base.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),i=require("react"),u=require("class-variance-authority"),c=require("@brightlocal/ui-components/lib/utils");function d(e){const n=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(n,t,a.get?a:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const f=d(i),r=u.cva(["flex w-full min-w-0 h-9","border border-input bg-background rounded-sm","outline-none transition-all","text-sm font-sans","text-foreground","overflow-hidden text-ellipsis","focus-visible:outline-none focus-visible:border-ring focus-visible:bg-background","focus-visible:shadow-default","disabled:cursor-not-allowed disabled:opacity-50","placeholder:text-muted-foreground","placeholder:overflow-hidden placeholder:text-ellipsis","items-center px-3 pb-[1px] leading-5"],{variants:{hasIcon:{true:"pl-9",false:""},hasSecondaryIcon:{true:"pr-9",false:""}},defaultVariants:{hasIcon:!1,hasSecondaryIcon:!1}}),o=f.forwardRef(({className:e,hasIcon:n=!1,hasSecondaryIcon:t=!1,...a},s)=>l.jsx("input",{ref:s,className:c.cn(r({hasIcon:n,hasSecondaryIcon:t}),e),"data-slot":"input",...a}));o.displayName="BaseInputElement";exports.BaseInputElement=o;exports.inputVariants=r;
|