@rolder/kit 3.0.0-alpha.87 → 3.0.0-alpha.88
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.
|
@@ -1,10 +1,7 @@
|
|
|
1
|
+
import { type ActionIconProps } from '@mantine/core';
|
|
1
2
|
import { type ReactNode } from '@tabler/icons-react';
|
|
2
|
-
export interface ScrollButtonProps {
|
|
3
|
-
/** CSS классы для стилизации кнопки */
|
|
4
|
-
className?: string;
|
|
5
|
-
/** Иконка для прокрутки вверх (по умолчанию IconChevronUp) */
|
|
3
|
+
export interface ScrollButtonProps extends ActionIconProps {
|
|
6
4
|
upIcon?: ReactNode;
|
|
7
|
-
/** Иконка для прокрутки вниз (по умолчанию IconChevronDown) */
|
|
8
5
|
downIcon?: ReactNode;
|
|
9
6
|
}
|
|
10
7
|
export declare const ScrollButton: React.FC<ScrollButtonProps>;
|
|
@@ -3,7 +3,7 @@ import { ActionIcon } from "@mantine/core";
|
|
|
3
3
|
import { IconChevronDown, IconChevronUp } from "@tabler/icons-react";
|
|
4
4
|
import { scrollToBottom, scrollToTop } from "./methods.js";
|
|
5
5
|
import { useHasScrollableContent, useIsAboveCenter } from "./store.js";
|
|
6
|
-
const ScrollButton = ({
|
|
6
|
+
const ScrollButton = ({ upIcon, downIcon, ...props })=>{
|
|
7
7
|
const hasScrollableContent = useHasScrollableContent();
|
|
8
8
|
const isScrollingDown = useIsAboveCenter();
|
|
9
9
|
if (!hasScrollableContent) return null;
|
|
@@ -22,8 +22,8 @@ const ScrollButton = ({ className, upIcon, downIcon })=>{
|
|
|
22
22
|
right: 16,
|
|
23
23
|
variant: "light",
|
|
24
24
|
onClick: handleClick,
|
|
25
|
-
className: className,
|
|
26
25
|
"aria-label": isScrollingDown ? 'Scroll to bottom' : 'Scroll to top',
|
|
26
|
+
...props,
|
|
27
27
|
children: icon
|
|
28
28
|
});
|
|
29
29
|
};
|