@brightlocal/ui-components 2.16.0 → 2.17.1

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.
@@ -274,20 +274,45 @@ const SheetFooter = React.forwardRef<
274
274
  ));
275
275
  SheetFooter.displayName = "SheetFooter";
276
276
 
277
+ /**
278
+ * Props for the SheetTitle component
279
+ */
280
+ interface SheetTitleProps extends React.ComponentProps<
281
+ typeof SheetPrimitive.Title
282
+ > {
283
+ /**
284
+ * Optional icon rendered before the title text.
285
+ * Pass any React node (typically a DS icon component).
286
+ * @example <SheetTitle icon={<Heart />}>Title</SheetTitle>
287
+ */
288
+ icon?: React.ReactNode;
289
+ }
290
+
277
291
  /**
278
292
  * Sheet title component for the main heading.
279
293
  * Should be used within SheetHeader.
280
294
  */
281
295
  const SheetTitle = React.forwardRef<
282
296
  React.ComponentRef<typeof SheetPrimitive.Title>,
283
- React.ComponentProps<typeof SheetPrimitive.Title>
284
- >(({ className, ...props }, ref) => (
297
+ SheetTitleProps
298
+ >(({ className, icon, children, ...props }, ref) => (
285
299
  <SheetPrimitive.Title
286
300
  ref={ref}
287
- className={cn("text-foreground text-lg font-semibold", className)}
301
+ className={cn(
302
+ "text-foreground text-lg font-semibold",
303
+ icon && "flex items-center gap-2",
304
+ className
305
+ )}
288
306
  data-slot="sheet-title"
289
307
  {...props}
290
- />
308
+ >
309
+ {icon && (
310
+ <span className="shrink-0 [&_svg]:size-5" data-slot="sheet-title-icon">
311
+ {icon}
312
+ </span>
313
+ )}
314
+ {children}
315
+ </SheetPrimitive.Title>
291
316
  ));
292
317
  SheetTitle.displayName = "SheetTitle";
293
318
 
@@ -321,4 +346,4 @@ export {
321
346
  SheetTrigger,
322
347
  };
323
348
 
324
- export type { SheetContentProps, SheetTriggerProps };
349
+ export type { SheetContentProps, SheetTitleProps, SheetTriggerProps };