@yakad/ui 1.3.163 → 1.3.165
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/ActiveOnVisible/ActiveOnVisible.js +2 -1
- package/dist/AppBar/AppBar.d.ts +1 -1
- package/dist/AppBar/AppBar.js +2 -2
- package/dist/Avatar/Avatar.d.ts +1 -1
- package/dist/Avatar/Avatar.js +2 -2
- package/dist/Button/Button.d.ts +1 -1
- package/dist/Button/Button.js +2 -2
- package/dist/Card/Card.d.ts +1 -1
- package/dist/Card/Card.js +2 -2
- package/dist/CheckBox/CheckBox.d.ts +1 -1
- package/dist/CheckBox/CheckBox.js +2 -2
- package/dist/CodeBox/CodeBox.d.ts +2 -3
- package/dist/CodeBox/CodeBox.js +2 -2
- package/dist/CodeField/CodeField.d.ts +1 -1
- package/dist/CodeField/CodeField.js +2 -2
- package/dist/Container/Container.d.ts +1 -1
- package/dist/Container/Container.js +2 -2
- package/dist/Display/Display.d.ts +1 -1
- package/dist/Display/Display.js +2 -2
- package/dist/Dropdown/Dropdown.d.ts +2 -1
- package/dist/Dropdown/Dropdown.js +18 -4
- package/dist/Footer/Footer.d.ts +1 -1
- package/dist/Footer/Footer.js +2 -2
- package/dist/Form/Form.d.ts +1 -1
- package/dist/Form/Form.js +2 -2
- package/dist/GridContainer/GridContainer.d.ts +1 -1
- package/dist/GridContainer/GridContainer.js +2 -2
- package/dist/GridItem/GridItem.d.ts +1 -1
- package/dist/GridItem/GridItem.js +2 -2
- package/dist/Hr/Hr.d.ts +2 -3
- package/dist/Hr/Hr.js +2 -2
- package/dist/InputField/InputField.d.ts +1 -1
- package/dist/InputField/InputField.js +2 -2
- package/dist/List/List.d.ts +2 -3
- package/dist/List/List.js +2 -2
- package/dist/ListItem/ListItem.d.ts +2 -3
- package/dist/ListItem/ListItem.js +2 -2
- package/dist/LoadingIcon/LoadingIcon.d.ts +2 -3
- package/dist/LoadingIcon/LoadingIcon.js +2 -2
- package/dist/Main/Main.d.ts +2 -3
- package/dist/Main/Main.js +2 -2
- package/dist/Navigation/Navigation.d.ts +2 -3
- package/dist/Navigation/Navigation.js +2 -2
- package/dist/Popup/Popup.d.ts +2 -1
- package/dist/Popup/Popup.js +18 -4
- package/dist/RadioButton/RadioButton.d.ts +1 -1
- package/dist/RadioButton/RadioButton.js +2 -2
- package/dist/RadioGroup/RadioGroup.d.ts +2 -3
- package/dist/RadioGroup/RadioGroup.js +2 -2
- package/dist/RenderByScroll/RenderByScroll.d.ts +1 -1
- package/dist/RenderByScroll/RenderByScroll.js +4 -3
- package/dist/Row/Row.d.ts +2 -3
- package/dist/Row/Row.js +2 -2
- package/dist/Screen/Screen.d.ts +2 -3
- package/dist/Screen/Screen.js +2 -2
- package/dist/Select/Select.d.ts +2 -3
- package/dist/Select/Select.js +2 -2
- package/dist/Spacer/Spacer.d.ts +2 -3
- package/dist/Spacer/Spacer.js +2 -2
- package/dist/Stack/Stack.d.ts +1 -1
- package/dist/Stack/Stack.js +2 -2
- package/dist/SvgIcon/SvgIcon.d.ts +2 -3
- package/dist/SvgIcon/SvgIcon.js +2 -2
- package/dist/Table/Table.d.ts +14 -21
- package/dist/Table/Table.js +14 -14
- package/dist/Text/Text.d.ts +9 -9
- package/dist/Text/Text.js +18 -18
- package/dist/Theme/Theme.d.ts +1 -1
- package/dist/Theme/Theme.js +2 -2
- package/dist/WithOverlay/WithOverlay.js +12 -23
- package/dist/index.d.ts +0 -10
- package/dist/index.js +0 -10
- package/package.json +2 -1
- package/dist/interactionHooks/useOnDoubleTap.d.ts +0 -2
- package/dist/interactionHooks/useOnDoubleTap.js +0 -23
- package/dist/interactionHooks/useOnHoverChange.d.ts +0 -2
- package/dist/interactionHooks/useOnHoverChange.js +0 -23
- package/dist/interactionHooks/useOnOutsideClick.d.ts +0 -2
- package/dist/interactionHooks/useOnOutsideClick.js +0 -21
- package/dist/interactionHooks/useOnPinch.d.ts +0 -2
- package/dist/interactionHooks/useOnPinch.js +0 -35
- package/dist/interactionHooks/useOnResizeChange.d.ts +0 -2
- package/dist/interactionHooks/useOnResizeChange.js +0 -23
- package/dist/interactionHooks/useOnRightClick.d.ts +0 -2
- package/dist/interactionHooks/useOnRightClick.js +0 -19
- package/dist/interactionHooks/useOnRotate.d.ts +0 -2
- package/dist/interactionHooks/useOnRotate.js +0 -36
- package/dist/interactionHooks/useOnScroll.d.ts +0 -2
- package/dist/interactionHooks/useOnScroll.js +0 -29
- package/dist/interactionHooks/useOnSwipe.d.ts +0 -2
- package/dist/interactionHooks/useOnSwipe.js +0 -53
- package/dist/interactionHooks/useOnVisibilityChange.d.ts +0 -2
- package/dist/interactionHooks/useOnVisibilityChange.js +0 -21
|
@@ -16,7 +16,7 @@ import { Symbol } from "@yakad/symbols";
|
|
|
16
16
|
import { Button } from "..";
|
|
17
17
|
import styles from "./RadioButton.module.css";
|
|
18
18
|
export function RadioButton(_a) {
|
|
19
|
-
var { dataFromRadioGroup, label, onClick, className
|
|
19
|
+
var { dataFromRadioGroup, label, onClick, className } = _a, restProps = __rest(_a, ["dataFromRadioGroup", "label", "onClick", "className"]);
|
|
20
20
|
const joinedClassNames = classNames(styles.radiobutton, {
|
|
21
21
|
[styles.labeled]: label,
|
|
22
22
|
className,
|
|
@@ -27,5 +27,5 @@ export function RadioButton(_a) {
|
|
|
27
27
|
};
|
|
28
28
|
return (_jsxs("div", { className: joinedClassNames, children: [label && (_jsx("label", { className: styles.label, htmlFor: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.name, children: label })), _jsx(Button, { icon: _jsx(Symbol, { icon: (dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.checked)
|
|
29
29
|
? "radio_button_checked"
|
|
30
|
-
: "radio_button_unchecked" }), onClick: onClickRadioButtonHandler, disabled: restProps.disabled }), _jsx("input", Object.assign({
|
|
30
|
+
: "radio_button_unchecked" }), onClick: onClickRadioButtonHandler, disabled: restProps.disabled }), _jsx("input", Object.assign({}, restProps, { className: styles.input, type: "radio", name: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.name, checked: dataFromRadioGroup === null || dataFromRadioGroup === void 0 ? void 0 : dataFromRadioGroup.checked }))] }));
|
|
31
31
|
}
|
|
@@ -6,8 +6,7 @@ export interface RadioGroupProps extends Omit<React.HTMLAttributes<HTMLDivElemen
|
|
|
6
6
|
name: string;
|
|
7
7
|
defaultValue?: string;
|
|
8
8
|
children?: RadioButtonElement | RadioButtonElement[];
|
|
9
|
-
}
|
|
10
|
-
export declare function RadioGroup({ name, defaultValue, className, children, ref, ...restProps }: RadioGroupProps & {
|
|
11
9
|
ref?: React.Ref<HTMLDivElement>;
|
|
12
|
-
}
|
|
10
|
+
}
|
|
11
|
+
export declare function RadioGroup({ name, defaultValue, className, children, ...restProps }: RadioGroupProps): import("react/jsx-runtime").JSX.Element;
|
|
13
12
|
export {};
|
|
@@ -14,7 +14,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
14
14
|
import { useState, Children } from "react";
|
|
15
15
|
import { RadioButton } from "..";
|
|
16
16
|
export function RadioGroup(_a) {
|
|
17
|
-
var { name, defaultValue, className, children
|
|
17
|
+
var { name, defaultValue, className, children } = _a, restProps = __rest(_a, ["name", "defaultValue", "className", "children"]);
|
|
18
18
|
const [selectedValue, setSelectedValue] = useState(defaultValue || null);
|
|
19
19
|
const arrayChildren = Children.toArray(children);
|
|
20
20
|
const renderChildrens = () => arrayChildren.map((child, index) => (_jsx(RadioButton, Object.assign({}, child.props, { dataFromRadioGroup: {
|
|
@@ -22,5 +22,5 @@ export function RadioGroup(_a) {
|
|
|
22
22
|
onSelect: () => setSelectedValue(child.props.value),
|
|
23
23
|
checked: selectedValue === child.props.value,
|
|
24
24
|
} }), index)));
|
|
25
|
-
return (_jsx("div", Object.assign({
|
|
25
|
+
return (_jsx("div", Object.assign({}, restProps, { className: className, children: renderChildrens() })));
|
|
26
26
|
}
|
|
@@ -10,4 +10,4 @@ export interface RenderByScrollProps extends StackProps {
|
|
|
10
10
|
ref?: React.Ref<HTMLDivElement>;
|
|
11
11
|
}
|
|
12
12
|
export declare function RenderByScroll({ scrollMarginTop, // Sticky Header Height
|
|
13
|
-
extraRender, jumpToIndex, stopNewRenders, newChildRendered, style, children,
|
|
13
|
+
extraRender, jumpToIndex, stopNewRenders, newChildRendered, style, children, ...restProps }: RenderByScrollProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -12,10 +12,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
14
|
import React, { useEffect, useRef, useState } from "react";
|
|
15
|
-
import { ActiveOnVisible, Stack
|
|
15
|
+
import { ActiveOnVisible, Stack } from "..";
|
|
16
|
+
import { useOnVisibilityChange } from "@yakad/use-interactions";
|
|
16
17
|
export function RenderByScroll(_a) {
|
|
17
18
|
var { scrollMarginTop = 8, // Sticky Header Height
|
|
18
|
-
extraRender = 5, jumpToIndex = 0, stopNewRenders, newChildRendered, style, children
|
|
19
|
+
extraRender = 5, jumpToIndex = 0, stopNewRenders, newChildRendered, style, children } = _a, restProps = __rest(_a, ["scrollMarginTop", "extraRender", "jumpToIndex", "stopNewRenders", "newChildRendered", "style", "children"]);
|
|
19
20
|
const childrenArray = React.Children.toArray(children);
|
|
20
21
|
// Scroll Zone
|
|
21
22
|
const childRefs = useRef({});
|
|
@@ -83,7 +84,7 @@ export function RenderByScroll(_a) {
|
|
|
83
84
|
const onvisibRef = useOnVisibilityChange((visible) => {
|
|
84
85
|
setIsVisibleLowSideLimitSensor(visible);
|
|
85
86
|
});
|
|
86
|
-
return (_jsxs(Stack, Object.assign({
|
|
87
|
+
return (_jsxs(Stack, Object.assign({}, restProps, { style: Object.assign({ minHeight: "100vh" }, style), children: [rendered.lowest > 0 && (_jsx("div", { ref: onvisibRef, style: {
|
|
87
88
|
marginBottom: `${scrollMarginTop}rem`,
|
|
88
89
|
} })), childrenArray.map((child, i) => i >= rendered.lowest &&
|
|
89
90
|
i <= rendered.highest && (_jsx(ActiveOnVisible, { ref: (el) => {
|
package/dist/Row/Row.d.ts
CHANGED
|
@@ -5,7 +5,6 @@ export interface RowProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
overflow?: "shrink" | "wrap" | "scroll";
|
|
6
6
|
size?: "xs" | "sm" | "md" | "lg" | "xl";
|
|
7
7
|
children?: React.ReactNode;
|
|
8
|
-
}
|
|
9
|
-
export declare function Row({ align, fullWidthOnParentDemand, overflow, size, className, children, ref, ...restProps }: RowProps & {
|
|
10
8
|
ref?: React.Ref<HTMLDivElement>;
|
|
11
|
-
}
|
|
9
|
+
}
|
|
10
|
+
export declare function Row({ align, fullWidthOnParentDemand, overflow, size, className, children, ...restProps }: RowProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Row/Row.js
CHANGED
|
@@ -14,7 +14,7 @@ import classNames from "classnames";
|
|
|
14
14
|
import boxingStyles from "../boxing.module.css";
|
|
15
15
|
import styles from "./Row.module.css";
|
|
16
16
|
export function Row(_a) {
|
|
17
|
-
var { align, fullWidthOnParentDemand = true, overflow = "shrink", size = "xl", className, children
|
|
17
|
+
var { align, fullWidthOnParentDemand = true, overflow = "shrink", size = "xl", className, children } = _a, restProps = __rest(_a, ["align", "fullWidthOnParentDemand", "overflow", "size", "className", "children"]);
|
|
18
18
|
const joinedClassNames = classNames(boxingStyles.flexRowBox, { [boxingStyles[align]]: align }, boxingStyles[overflow], styles.row, { [boxingStyles.fullWidthOnParentDemand]: fullWidthOnParentDemand }, styles[size], className);
|
|
19
|
-
return (_jsx("div", Object.assign({
|
|
19
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
}
|
package/dist/Screen/Screen.d.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export interface ScreenProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
align?: "start" | "space" | "center" | "end";
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare function Screen({ align, className, children, ref, ...restProps }: ScreenProps & {
|
|
7
5
|
ref?: React.Ref<HTMLDivElement>;
|
|
8
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export declare function Screen({ align, className, children, ...restProps }: ScreenProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Screen/Screen.js
CHANGED
|
@@ -14,7 +14,7 @@ import classNames from "classnames";
|
|
|
14
14
|
import boxingStyles from "../boxing.module.css";
|
|
15
15
|
import styles from "./Screen.module.css";
|
|
16
16
|
export function Screen(_a) {
|
|
17
|
-
var { align, className, children
|
|
17
|
+
var { align, className, children } = _a, restProps = __rest(_a, ["align", "className", "children"]);
|
|
18
18
|
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { [boxingStyles.demandChildsToBeFullWidth]: true }, styles.screen, className);
|
|
19
|
-
return (_jsx("div", Object.assign({
|
|
19
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
}
|
package/dist/Select/Select.d.ts
CHANGED
|
@@ -4,7 +4,6 @@ export interface SelectProps extends React.SelectHTMLAttributes<HTMLSelectElemen
|
|
|
4
4
|
boxsize?: "small" | "normal";
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
children?: React.ReactNode;
|
|
7
|
-
}
|
|
8
|
-
export declare function Select({ variant, boxsize, placeholder, className, children, ref, ...restProps }: SelectProps & {
|
|
9
7
|
ref?: React.Ref<HTMLSelectElement>;
|
|
10
|
-
}
|
|
8
|
+
}
|
|
9
|
+
export declare function Select({ variant, boxsize, placeholder, className, children, ...restProps }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Select/Select.js
CHANGED
|
@@ -15,7 +15,7 @@ import boxingStyles from "../boxing.module.css";
|
|
|
15
15
|
import styles from "./Select.module.css";
|
|
16
16
|
import inputStyles from "../InputField/InputField.module.css";
|
|
17
17
|
export function Select(_a) {
|
|
18
|
-
var { variant = "outlined", boxsize = "normal", placeholder, className, children
|
|
18
|
+
var { variant = "outlined", boxsize = "normal", placeholder, className, children } = _a, restProps = __rest(_a, ["variant", "boxsize", "placeholder", "className", "children"]);
|
|
19
19
|
const joinedClassNames = classNames(styles.select, inputStyles.input, inputStyles[variant], inputStyles[boxsize], { [inputStyles.havePlaceHolder]: placeholder }, className);
|
|
20
|
-
return (_jsxs("div", { className: classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, inputStyles.div), children: [_jsx("select", Object.assign({
|
|
20
|
+
return (_jsxs("div", { className: classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, inputStyles.div), children: [_jsx("select", Object.assign({}, restProps, { className: joinedClassNames, children: children })), placeholder ? (_jsx("label", { className: inputStyles.label, children: placeholder })) : null] }));
|
|
21
21
|
}
|
package/dist/Spacer/Spacer.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface SpacerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "children"> {
|
|
3
|
-
}
|
|
4
|
-
export declare function Spacer({ className, ref, ...restProps }: SpacerProps & {
|
|
5
3
|
ref?: React.Ref<HTMLDivElement>;
|
|
6
|
-
}
|
|
4
|
+
}
|
|
5
|
+
export declare function Spacer({ className, ...restProps }: SpacerProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Spacer/Spacer.js
CHANGED
|
@@ -13,7 +13,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import styles from "./Spacer.module.css";
|
|
15
15
|
export function Spacer(_a) {
|
|
16
|
-
var { className
|
|
16
|
+
var { className } = _a, restProps = __rest(_a, ["className"]);
|
|
17
17
|
const joinedClassNames = classNames(styles.spacer, className);
|
|
18
|
-
return _jsx("div", Object.assign({
|
|
18
|
+
return _jsx("div", Object.assign({}, restProps, { className: joinedClassNames }));
|
|
19
19
|
}
|
package/dist/Stack/Stack.d.ts
CHANGED
|
@@ -5,4 +5,4 @@ export interface StackProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
children?: React.ReactNode;
|
|
6
6
|
ref?: React.Ref<HTMLDivElement>;
|
|
7
7
|
}
|
|
8
|
-
export declare function Stack({ align, fullWidthOnParentDemand, className, children,
|
|
8
|
+
export declare function Stack({ align, fullWidthOnParentDemand, className, children, ...restProps }: StackProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Stack/Stack.js
CHANGED
|
@@ -14,7 +14,7 @@ import classNames from "classnames";
|
|
|
14
14
|
import boxingStyles from "../boxing.module.css";
|
|
15
15
|
import styles from "./Stack.module.css";
|
|
16
16
|
export function Stack(_a) {
|
|
17
|
-
var { align, fullWidthOnParentDemand = true, className, children
|
|
17
|
+
var { align, fullWidthOnParentDemand = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidthOnParentDemand", "className", "children"]);
|
|
18
18
|
const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { [boxingStyles.demandChildsToBeFullWidth]: true }, { [boxingStyles.fullWidthOnParentDemand]: fullWidthOnParentDemand }, styles.stack, className);
|
|
19
|
-
return (_jsx("div", Object.assign({
|
|
19
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
export interface SvgIconProps extends React.HTMLAttributes<HTMLElement> {
|
|
3
3
|
size?: number;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
|
-
}
|
|
6
|
-
export declare function SvgIcon({ size, className, style, children, ref, ...restProps }: SvgIconProps & {
|
|
7
5
|
ref?: React.Ref<HTMLDivElement>;
|
|
8
|
-
}
|
|
6
|
+
}
|
|
7
|
+
export declare function SvgIcon({ size, className, style, children, ...restProps }: SvgIconProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/SvgIcon/SvgIcon.js
CHANGED
|
@@ -13,8 +13,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import styles from "./SvgIcon.module.css";
|
|
15
15
|
export function SvgIcon(_a) {
|
|
16
|
-
var { size, className, style, children
|
|
16
|
+
var { size, className, style, children } = _a, restProps = __rest(_a, ["size", "className", "style", "children"]);
|
|
17
17
|
const joinedClassNames = classNames(styles.svg, className);
|
|
18
18
|
const sizeStyle = size && { width: `${size}rem`, height: `${size}rem` };
|
|
19
|
-
return (_jsx("div", Object.assign({
|
|
19
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, style: Object.assign(Object.assign({}, style), sizeStyle), children: children })));
|
|
20
20
|
}
|
package/dist/Table/Table.d.ts
CHANGED
|
@@ -1,43 +1,36 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export interface TableProps extends React.TableHTMLAttributes<HTMLTableElement> {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
export declare function Table({ className, children, ref, ...restProps }: TableProps & {
|
|
6
4
|
ref?: React.Ref<HTMLTableElement>;
|
|
7
|
-
}
|
|
5
|
+
}
|
|
6
|
+
export declare function Table({ className, children, ...restProps }: TableProps): import("react/jsx-runtime").JSX.Element;
|
|
8
7
|
export interface TheadProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
9
8
|
children?: React.ReactNode;
|
|
10
|
-
}
|
|
11
|
-
export declare function Thead({ className, children, ref, ...restProps }: TheadProps & {
|
|
12
9
|
ref?: React.Ref<HTMLTableSectionElement>;
|
|
13
|
-
}
|
|
10
|
+
}
|
|
11
|
+
export declare function Thead({ className, children, ...restProps }: TheadProps): import("react/jsx-runtime").JSX.Element;
|
|
14
12
|
export interface TbodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
15
13
|
children?: React.ReactNode;
|
|
16
|
-
}
|
|
17
|
-
export declare function Tbody({ className, children, ref, ...restProps }: TbodyProps & {
|
|
18
14
|
ref?: React.Ref<HTMLTableSectionElement>;
|
|
19
|
-
}
|
|
15
|
+
}
|
|
16
|
+
export declare function Tbody({ className, children, ...restProps }: TbodyProps): import("react/jsx-runtime").JSX.Element;
|
|
20
17
|
export interface TfootProps extends React.HTMLAttributes<HTMLTableSectionElement> {
|
|
21
18
|
children?: React.ReactNode;
|
|
22
|
-
}
|
|
23
|
-
export declare function Tfoot({ className, children, ref, ...restProps }: TfootProps & {
|
|
24
19
|
ref?: React.Ref<HTMLTableSectionElement>;
|
|
25
|
-
}
|
|
20
|
+
}
|
|
21
|
+
export declare function Tfoot({ className, children, ...restProps }: TfootProps): import("react/jsx-runtime").JSX.Element;
|
|
26
22
|
export interface TrProps extends React.HTMLAttributes<HTMLTableRowElement> {
|
|
27
23
|
children?: React.ReactNode;
|
|
28
|
-
}
|
|
29
|
-
export declare function Tr({ className, children, ref, ...restProps }: TrProps & {
|
|
30
24
|
ref?: React.Ref<HTMLTableRowElement>;
|
|
31
|
-
}
|
|
25
|
+
}
|
|
26
|
+
export declare function Tr({ className, children, ...restProps }: TrProps): import("react/jsx-runtime").JSX.Element;
|
|
32
27
|
export interface ThProps extends React.HTMLAttributes<HTMLTableCellElement> {
|
|
33
28
|
children?: React.ReactNode;
|
|
34
|
-
}
|
|
35
|
-
export declare function Th({ className, children, ref, ...restProps }: ThProps & {
|
|
36
29
|
ref?: React.Ref<HTMLTableCellElement>;
|
|
37
|
-
}
|
|
30
|
+
}
|
|
31
|
+
export declare function Th({ className, children, ...restProps }: ThProps): import("react/jsx-runtime").JSX.Element;
|
|
38
32
|
export interface TdProps extends React.HTMLAttributes<HTMLTableCellElement> {
|
|
39
33
|
children?: React.ReactNode;
|
|
40
|
-
}
|
|
41
|
-
export declare function Td({ className, children, ref, ...restProps }: TdProps & {
|
|
42
34
|
ref?: React.Ref<HTMLTableCellElement>;
|
|
43
|
-
}
|
|
35
|
+
}
|
|
36
|
+
export declare function Td({ className, children, ...restProps }: TdProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Table/Table.js
CHANGED
|
@@ -14,37 +14,37 @@ import classNames from "classnames";
|
|
|
14
14
|
import boxingStyles from "../boxing.module.css";
|
|
15
15
|
import styles from "./Table.module.css";
|
|
16
16
|
export function Table(_a) {
|
|
17
|
-
var { className, children
|
|
17
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
18
18
|
const joinedClassNames = classNames({ [boxingStyles.fullWidthOnParentDemand]: true }, styles.table, className);
|
|
19
|
-
return (_jsx("table", Object.assign({
|
|
19
|
+
return (_jsx("table", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
20
20
|
}
|
|
21
21
|
export function Thead(_a) {
|
|
22
|
-
var { className, children
|
|
22
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
23
23
|
const joinedClassNames = classNames(styles.thead, className);
|
|
24
|
-
return (_jsx("thead", Object.assign({
|
|
24
|
+
return (_jsx("thead", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
25
25
|
}
|
|
26
26
|
export function Tbody(_a) {
|
|
27
|
-
var { className, children
|
|
27
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
28
28
|
const joinedClassNames = classNames(styles.tbody, className);
|
|
29
|
-
return (_jsx("tbody", Object.assign({
|
|
29
|
+
return (_jsx("tbody", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
30
30
|
}
|
|
31
31
|
export function Tfoot(_a) {
|
|
32
|
-
var { className, children
|
|
32
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
33
33
|
const joinedClassNames = classNames(styles.tfoot, className);
|
|
34
|
-
return (_jsx("tfoot", Object.assign({
|
|
34
|
+
return (_jsx("tfoot", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
35
35
|
}
|
|
36
36
|
export function Tr(_a) {
|
|
37
|
-
var { className, children
|
|
37
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
38
38
|
const joinedClassNames = classNames(styles.tr, className);
|
|
39
|
-
return (_jsx("tr", Object.assign({
|
|
39
|
+
return (_jsx("tr", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
40
40
|
}
|
|
41
41
|
export function Th(_a) {
|
|
42
|
-
var { className, children
|
|
42
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
43
43
|
const joinedClassNames = classNames(styles.th, className);
|
|
44
|
-
return (_jsx("th", Object.assign({
|
|
44
|
+
return (_jsx("th", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
45
45
|
}
|
|
46
46
|
export function Td(_a) {
|
|
47
|
-
var { className, children
|
|
47
|
+
var { className, children } = _a, restProps = __rest(_a, ["className", "children"]);
|
|
48
48
|
const joinedClassNames = classNames(styles.td, className);
|
|
49
|
-
return (_jsx("td", Object.assign({
|
|
49
|
+
return (_jsx("td", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
50
50
|
}
|
package/dist/Text/Text.d.ts
CHANGED
|
@@ -6,13 +6,13 @@ export interface TextProps<T> extends React.HTMLAttributes<T> {
|
|
|
6
6
|
children?: React.ReactNode;
|
|
7
7
|
ref?: React.Ref<T>;
|
|
8
8
|
}
|
|
9
|
-
export declare function H1({ variant, palette, className, children,
|
|
10
|
-
export declare function H2({ variant, palette, className, children,
|
|
11
|
-
export declare function H3({ variant, palette, className, children,
|
|
12
|
-
export declare function H4({ variant, palette, className, children,
|
|
13
|
-
export declare function H5({ variant, palette, className, children,
|
|
14
|
-
export declare function H6({ variant, palette, className, children,
|
|
15
|
-
export declare function P({ variant, palette, className, children,
|
|
16
|
-
export declare function Span({ variant, palette, className, children,
|
|
17
|
-
export declare function Text({ variant, palette, className, children,
|
|
9
|
+
export declare function H1({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function H2({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function H3({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export declare function H4({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export declare function H5({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export declare function H6({ variant, palette, className, children, ...restProps }: TextProps<HTMLHeadingElement>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function P({ variant, palette, className, children, ...restProps }: TextProps<HTMLParagraphElement>): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export declare function Span({ variant, palette, className, children, ...restProps }: TextProps<HTMLSpanElement>): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function Text({ variant, palette, className, children, ...restProps }: TextProps<HTMLDivElement>): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export {};
|
package/dist/Text/Text.js
CHANGED
|
@@ -13,74 +13,74 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import styles from "./Text.module.css";
|
|
15
15
|
export function H1(_a) {
|
|
16
|
-
var { variant = "heading1", palette, className, children
|
|
16
|
+
var { variant = "heading1", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
17
17
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
18
18
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
19
19
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
20
20
|
}, className);
|
|
21
|
-
return (_jsx("h1", Object.assign({
|
|
21
|
+
return (_jsx("h1", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
22
22
|
}
|
|
23
23
|
export function H2(_a) {
|
|
24
|
-
var { variant = "heading2", palette, className, children
|
|
24
|
+
var { variant = "heading2", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
25
25
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
26
26
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
27
27
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
28
28
|
}, className);
|
|
29
|
-
return (_jsx("h2", Object.assign({
|
|
29
|
+
return (_jsx("h2", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
30
30
|
}
|
|
31
31
|
export function H3(_a) {
|
|
32
|
-
var { variant = "heading3", palette, className, children
|
|
32
|
+
var { variant = "heading3", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
33
33
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
34
34
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
35
35
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
36
36
|
}, className);
|
|
37
|
-
return (_jsx("h3", Object.assign({
|
|
37
|
+
return (_jsx("h3", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
38
38
|
}
|
|
39
39
|
export function H4(_a) {
|
|
40
|
-
var { variant = "heading4", palette, className, children
|
|
40
|
+
var { variant = "heading4", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
41
41
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
42
42
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
43
43
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
44
44
|
}, className);
|
|
45
|
-
return (_jsx("h4", Object.assign({
|
|
45
|
+
return (_jsx("h4", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
46
46
|
}
|
|
47
47
|
export function H5(_a) {
|
|
48
|
-
var { variant = "heading5", palette, className, children
|
|
48
|
+
var { variant = "heading5", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
49
49
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
50
50
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
51
51
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
52
52
|
}, className);
|
|
53
|
-
return (_jsx("h5", Object.assign({
|
|
53
|
+
return (_jsx("h5", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
54
54
|
}
|
|
55
55
|
export function H6(_a) {
|
|
56
|
-
var { variant = "heading6", palette, className, children
|
|
56
|
+
var { variant = "heading6", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
57
57
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
58
58
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
59
59
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
60
60
|
}, className);
|
|
61
|
-
return (_jsx("h6", Object.assign({
|
|
61
|
+
return (_jsx("h6", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
62
62
|
}
|
|
63
63
|
export function P(_a) {
|
|
64
|
-
var { variant = "body5", palette, className, children
|
|
64
|
+
var { variant = "body5", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
65
65
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
66
66
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
67
67
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
68
68
|
}, className);
|
|
69
|
-
return (_jsx("p", Object.assign({
|
|
69
|
+
return (_jsx("p", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
70
70
|
}
|
|
71
71
|
export function Span(_a) {
|
|
72
|
-
var { variant = "span", palette, className, children
|
|
72
|
+
var { variant = "span", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
73
73
|
const joinedClassNames = classNames(styles.text, styles[variant], {
|
|
74
74
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
75
75
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
76
76
|
}, className);
|
|
77
|
-
return (_jsx("span", Object.assign({
|
|
77
|
+
return (_jsx("span", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
78
78
|
}
|
|
79
79
|
export function Text(_a) {
|
|
80
|
-
var { variant = "body5", palette, className, children
|
|
80
|
+
var { variant = "body5", palette, className, children } = _a, restProps = __rest(_a, ["variant", "palette", "className", "children"]);
|
|
81
81
|
const joinedClassNames = classNames(styles[variant], {
|
|
82
82
|
[styles.onSurfaceColor]: palette === "onSurfaceColor",
|
|
83
83
|
[styles.onSurfaceVariantColor]: palette === "onSurfaceVariantColor",
|
|
84
84
|
}, className);
|
|
85
|
-
return (_jsx("div", Object.assign({
|
|
85
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
86
86
|
}
|
package/dist/Theme/Theme.d.ts
CHANGED
|
@@ -10,4 +10,4 @@ export interface ThemeProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
10
10
|
children?: React.ReactNode;
|
|
11
11
|
ref?: React.Ref<HTMLDivElement>;
|
|
12
12
|
}
|
|
13
|
-
export declare function Theme({ align, darkStyle, color, zoom, className, children,
|
|
13
|
+
export declare function Theme({ align, darkStyle, color, zoom, className, children, ...restProps }: ThemeProps): import("react/jsx-runtime").JSX.Element;
|
package/dist/Theme/Theme.js
CHANGED
|
@@ -17,11 +17,11 @@ import "./globals.css";
|
|
|
17
17
|
import styles from "./Theme.module.css";
|
|
18
18
|
import boxingStyles from "../boxing.module.css";
|
|
19
19
|
export function Theme(_a) {
|
|
20
|
-
var { align, darkStyle = "system", color = "blue", zoom = 100, className, children
|
|
20
|
+
var { align, darkStyle = "system", color = "blue", zoom = 100, className, children } = _a, restProps = __rest(_a, ["align", "darkStyle", "color", "zoom", "className", "children"]);
|
|
21
21
|
const zoomPercentage = zoom ? (zoom / 100) * 62.5 : 62.5;
|
|
22
22
|
useEffect(() => {
|
|
23
23
|
document.documentElement.style.setProperty("font-size", zoomPercentage + "%");
|
|
24
24
|
}, [zoomPercentage]);
|
|
25
25
|
const joinedClassNames = classNames({ portalRoot: true }, boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { [boxingStyles.demandChildsToBeFullWidth]: true }, styles.theme, styles[darkStyle], styles[color], className);
|
|
26
|
-
return (_jsx("div", Object.assign({
|
|
26
|
+
return (_jsx("div", Object.assign({}, restProps, { className: joinedClassNames, children: children })));
|
|
27
27
|
}
|
|
@@ -11,9 +11,9 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
return t;
|
|
12
12
|
};
|
|
13
13
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
14
|
-
import { useState,
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { useState, useRef, useImperativeHandle, cloneElement, } from "react";
|
|
15
|
+
import { Stack, } from "..";
|
|
16
|
+
import { useOnRightClick } from "@yakad/use-interactions";
|
|
17
17
|
export function WithOverlay(_a) {
|
|
18
18
|
var { trigger = "onClick", overlay, children, onClick, ref } = _a, restProps = __rest(_a, ["trigger", "overlay", "children", "onClick", "ref"]);
|
|
19
19
|
// Get Triggers ref and send to Overlay
|
|
@@ -28,24 +28,13 @@ export function WithOverlay(_a) {
|
|
|
28
28
|
};
|
|
29
29
|
// Let the parent access our DOM node
|
|
30
30
|
useImperativeHandle(ref, () => localRef.current);
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const teleport = overlay &&
|
|
41
|
-
portalRoot &&
|
|
42
|
-
createPortal(cloneElement(overlay, {
|
|
43
|
-
triggerref: localRef,
|
|
44
|
-
onClose: () => {
|
|
45
|
-
var _a, _b;
|
|
46
|
-
(_b = (_a = overlay.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
47
|
-
setShowOverlay(false);
|
|
48
|
-
},
|
|
49
|
-
}), portalRoot);
|
|
50
|
-
return (_jsxs(_Fragment, { children: [_jsx(Stack, Object.assign({ ref: localRef }, restProps, { onClick: onClickHandler, children: children })), showOverlay && teleport] }));
|
|
31
|
+
const clonedOverlay = cloneElement(overlay, {
|
|
32
|
+
triggerref: localRef,
|
|
33
|
+
onClose: () => {
|
|
34
|
+
var _a, _b;
|
|
35
|
+
(_b = overlay === null || overlay === void 0 ? void 0 : (_a = overlay.props).onClose) === null || _b === void 0 ? void 0 : _b.call(_a);
|
|
36
|
+
setShowOverlay(false);
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
return (_jsxs(_Fragment, { children: [_jsx(Stack, Object.assign({ ref: localRef }, restProps, { onClick: onClickHandler, children: children })), showOverlay && clonedOverlay] }));
|
|
51
40
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -34,13 +34,3 @@ export * from "./ActiveOnVisible/ActiveOnVisible";
|
|
|
34
34
|
export * from "./Dropdown/Dropdown";
|
|
35
35
|
export * from "./Popup/Popup";
|
|
36
36
|
export * from "./Avatar/Avatar";
|
|
37
|
-
export * from "./interactionHooks/useOnRightClick";
|
|
38
|
-
export * from "./interactionHooks/useOnOutsideClick";
|
|
39
|
-
export * from "./interactionHooks/useOnDoubleTap";
|
|
40
|
-
export * from "./interactionHooks/useOnSwipe";
|
|
41
|
-
export * from "./interactionHooks/useOnPinch";
|
|
42
|
-
export * from "./interactionHooks/useOnRotate";
|
|
43
|
-
export * from "./interactionHooks/useOnResizeChange";
|
|
44
|
-
export * from "./interactionHooks/useOnVisibilityChange";
|
|
45
|
-
export * from "./interactionHooks/useOnHoverChange";
|
|
46
|
-
export * from "./interactionHooks/useOnScroll";
|
package/dist/index.js
CHANGED
|
@@ -40,13 +40,3 @@ export * from "./ActiveOnVisible/ActiveOnVisible"; // Stack Based
|
|
|
40
40
|
export * from "./Dropdown/Dropdown"; // Card Based
|
|
41
41
|
export * from "./Popup/Popup"; // Card Based
|
|
42
42
|
export * from "./Avatar/Avatar";
|
|
43
|
-
export * from "./interactionHooks/useOnRightClick";
|
|
44
|
-
export * from "./interactionHooks/useOnOutsideClick";
|
|
45
|
-
export * from "./interactionHooks/useOnDoubleTap";
|
|
46
|
-
export * from "./interactionHooks/useOnSwipe";
|
|
47
|
-
export * from "./interactionHooks/useOnPinch";
|
|
48
|
-
export * from "./interactionHooks/useOnRotate";
|
|
49
|
-
export * from "./interactionHooks/useOnResizeChange";
|
|
50
|
-
export * from "./interactionHooks/useOnVisibilityChange";
|
|
51
|
-
export * from "./interactionHooks/useOnHoverChange";
|
|
52
|
-
export * from "./interactionHooks/useOnScroll";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yakad/ui",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.165",
|
|
4
4
|
"private": false,
|
|
5
5
|
"author": "Natiq",
|
|
6
6
|
"description": "UI components for NextJS/React",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@yakad/lib": "1.0.23",
|
|
36
36
|
"@yakad/symbols": "1.0.29",
|
|
37
|
+
"@yakad/use-interactions": "1.0.0",
|
|
37
38
|
"classnames": "2.5.1"
|
|
38
39
|
},
|
|
39
40
|
"peerDependencies": {
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef, useState } from "react";
|
|
2
|
-
export function useOnDoubleTap(callback, ref) {
|
|
3
|
-
const defaultRef = useRef(null);
|
|
4
|
-
const targetRef = ref !== null && ref !== void 0 ? ref : defaultRef;
|
|
5
|
-
const [lastTap, setLastTap] = useState(0);
|
|
6
|
-
const handleDoubleTap = useCallback((e) => {
|
|
7
|
-
const now = Date.now();
|
|
8
|
-
if (now - lastTap < 300) {
|
|
9
|
-
callback(e);
|
|
10
|
-
}
|
|
11
|
-
setLastTap(now);
|
|
12
|
-
}, [callback, lastTap]);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const element = targetRef.current;
|
|
15
|
-
if (!element)
|
|
16
|
-
return;
|
|
17
|
-
element.addEventListener("touchend", handleDoubleTap);
|
|
18
|
-
return () => {
|
|
19
|
-
element.removeEventListener("touchend", handleDoubleTap);
|
|
20
|
-
};
|
|
21
|
-
}, [handleDoubleTap, targetRef]);
|
|
22
|
-
return targetRef;
|
|
23
|
-
}
|