@ttt-productions/ui-core 0.11.7 → 0.11.9

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.
@@ -5,12 +5,27 @@ import { ChevronUp } from "lucide-react";
5
5
  import { Button, type ButtonProps } from "./button.js";
6
6
  import { cn } from "../../lib/utils.js";
7
7
 
8
- export interface ScrollToTopButtonProps {
8
+ /**
9
+ * Standard button DOM props forwarded to the rendered element, minus the props
10
+ * this component owns. Owned props are excluded (not just overridden) so a
11
+ * consumer can never route them through the passthrough channel: `aria-label`
12
+ * is set via {@link ScrollToTopButtonProps.ariaLabel}, extra classes via the
13
+ * merge-aware {@link ScrollToTopButtonProps.className}, content via
14
+ * {@link ScrollToTopButtonProps.icon}, and `onClick` is fixed to scroll-to-top.
15
+ * This mirrors how the sibling `Button` destructures its owned `className` out
16
+ * of the forwarded `...props`.
17
+ */
18
+ type ScrollToTopButtonPassthrough = Omit<
19
+ React.ComponentPropsWithoutRef<"button">,
20
+ "className" | "onClick" | "aria-label" | "children"
21
+ >;
22
+
23
+ export interface ScrollToTopButtonProps extends ScrollToTopButtonPassthrough {
9
24
  /** Scroll threshold (px) before the button appears. Default 400. */
10
25
  threshold?: number;
11
26
  /** Aria label. Default "Scroll to top". */
12
27
  ariaLabel?: string;
13
- /** Optional extra classes for the button. */
28
+ /** Optional extra classes for the button. Merged with the component's own classes. */
14
29
  className?: string;
15
30
  /** Optional override for the icon. */
16
31
  icon?: React.ReactNode;
@@ -27,6 +42,7 @@ export function ScrollToTopButton({
27
42
  icon,
28
43
  variant,
29
44
  size = "icon",
45
+ ...rest
30
46
  }: ScrollToTopButtonProps) {
31
47
  const [isVisible, setIsVisible] = React.useState(false);
32
48
 
@@ -41,6 +57,7 @@ export function ScrollToTopButton({
41
57
 
42
58
  return (
43
59
  <Button
60
+ {...rest}
44
61
  variant={variant}
45
62
  size={size}
46
63
  onClick={onClick}