@yakad/ui 1.3.143 → 1.3.145

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.
@@ -39,7 +39,7 @@ export const RenderByScroll = forwardRef(function RenderByScroll(_a, ref) {
39
39
  const overRenderedOnLowSide = visibled.lowest - rendered.lowest;
40
40
  const overRenderedOnHighSide = rendered.highest - visibled.highest;
41
41
  // Is Visible Loading Box
42
- const [isVisibleLowSideLimitBox, setIsVisibleLowSideLimitBox] = useState(false);
42
+ const [isVisibleLowSideLimitSensor, setIsVisibleLowSideLimitSensor] = useState(false);
43
43
  // Render new Childs if needed
44
44
  useEffect(() => {
45
45
  const isPriorityBYHighSide = overRenderedOnHighSide < 1 ||
@@ -57,7 +57,7 @@ export const RenderByScroll = forwardRef(function RenderByScroll(_a, ref) {
57
57
  else {
58
58
  if (isLowSideNewRenderRemains &&
59
59
  overRenderedOnLowSide < extraRender) {
60
- if (isVisibleLowSideLimitBox) {
60
+ if (isVisibleLowSideLimitSensor) {
61
61
  scrollTo(rendered.lowest);
62
62
  }
63
63
  const newLow = rendered.lowest - 1;
@@ -82,13 +82,11 @@ export const RenderByScroll = forwardRef(function RenderByScroll(_a, ref) {
82
82
  // eslint-disable-next-line
83
83
  }, [jumpToIndex]);
84
84
  return (_jsxs(Stack, Object.assign({ ref: ref }, restProps, { style: Object.assign({ minHeight: "100vh" }, style), children: [rendered.lowest > 0 && (_jsx(WithInteractions, { style: {
85
- height: "1px",
86
- backgroundColor: "red",
87
85
  marginBottom: `${scrollMarginTop}rem`,
88
- }, onVisibilityChange: (v) => setIsVisibleLowSideLimitBox(v) })), childrenArray.map((child, i) => i >= rendered.lowest &&
86
+ }, onVisibilityChange: (v) => setIsVisibleLowSideLimitSensor(v) })), childrenArray.map((child, i) => i >= rendered.lowest &&
89
87
  i <= rendered.highest && (_jsx(WithInteractions, { ref: (el) => {
90
88
  childRefs.current[i] = el;
91
- }, onVisible: () => handleOnVisible(i), style: {
89
+ }, style: {
92
90
  scrollMarginTop: `${scrollMarginTop}rem`,
93
- }, children: child }, i)))] })));
91
+ }, onVisible: () => handleOnVisible(i), children: child }, i)))] })));
94
92
  });
@@ -15,7 +15,7 @@ import classNames from "classnames";
15
15
  import boxingStyles from "../boxing.module.css";
16
16
  import styles from "./Stack.module.css";
17
17
  export const Stack = forwardRef(function Stack(_a, ref) {
18
- var { align, fullWidth, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
18
+ var { align, fullWidth = true, className, children } = _a, restProps = __rest(_a, ["align", "fullWidth", "className", "children"]);
19
19
  const joinedClassNames = classNames(boxingStyles.flexColumnBox, { [boxingStyles[align]]: align }, { fullWidth: fullWidth }, styles.stack, className);
20
20
  return (_jsx("div", Object.assign({ ref: ref }, restProps, { className: joinedClassNames, children: children })));
21
21
  });
@@ -21,6 +21,5 @@ export interface WithInteractionsProps extends StackProps {
21
21
  onMouseHoverChange?: (isHover: boolean, e: MouseEvent) => void;
22
22
  onMouseHoverStart?: (e: MouseEvent) => void;
23
23
  onMouseHoverLeave?: (e: MouseEvent) => void;
24
- children?: React.ReactNode;
25
24
  }
26
25
  export declare const WithInteractions: import("react").ForwardRefExoticComponent<WithInteractionsProps & import("react").RefAttributes<HTMLElement>>;
@@ -1,14 +1,14 @@
1
1
  import { RefObject } from "react";
2
- import { Dropdown, DropdownProps, Popup, PopupProps } from "..";
2
+ import { Dropdown, DropdownProps, Popup, PopupProps, WithInteractionsProps } from "..";
3
3
  export interface OverlayProps {
4
4
  triggerref?: RefObject<HTMLElement | null>;
5
5
  onClose?: () => void;
6
6
  }
7
7
  type AllowedOverlays = React.ReactElement<PopupProps, typeof Popup> | React.ReactElement<DropdownProps, typeof Dropdown>;
8
- export interface WithOverlayProps {
8
+ export interface WithOverlayProps extends WithInteractionsProps {
9
9
  trigger?: "onClick" | "onRightClick";
10
10
  overlay?: AllowedOverlays;
11
11
  children?: React.ReactElement;
12
12
  }
13
- export declare function WithOverlay({ trigger, overlay, children, }: WithOverlayProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function WithOverlay({ trigger, overlay, children, onRightClick, onClick, ...restProps }: WithOverlayProps): import("react/jsx-runtime").JSX.Element;
14
14
  export {};
@@ -1,9 +1,21 @@
1
1
  "use client";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
2
13
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
3
14
  import { useState, cloneElement, useEffect, useRef } from "react";
4
15
  import { WithInteractions, } from "..";
5
16
  import { createPortal } from "react-dom";
6
- export function WithOverlay({ trigger = "onClick", overlay, children, }) {
17
+ export function WithOverlay(_a) {
18
+ var { trigger = "onClick", overlay, children, onRightClick, onClick } = _a, restProps = __rest(_a, ["trigger", "overlay", "children", "onRightClick", "onClick"]);
7
19
  // Get Triggers ref and send to Overlay
8
20
  const triggerRef = useRef(null);
9
21
  const [showOverlay, setShowOverlay] = useState(false);
@@ -24,5 +36,11 @@ export function WithOverlay({ trigger = "onClick", overlay, children, }) {
24
36
  setShowOverlay(false);
25
37
  },
26
38
  }), document.getElementsByClassName("portalRoot")[0] || document.body);
27
- return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, { ref: triggerRef, onRightClick: () => trigger === "onRightClick" && setShowOverlay(true), onClick: () => trigger === "onClick" && setShowOverlay(true), children: children }), showOverlay && teleport] }));
39
+ return (_jsxs(_Fragment, { children: [_jsx(WithInteractions, Object.assign({ ref: triggerRef }, restProps, { onRightClick: (e) => {
40
+ trigger === "onRightClick" && setShowOverlay(true);
41
+ onRightClick === null || onRightClick === void 0 ? void 0 : onRightClick(e);
42
+ }, onClick: (e) => {
43
+ trigger === "onClick" && setShowOverlay(true);
44
+ onClick === null || onClick === void 0 ? void 0 : onClick(e);
45
+ }, children: children })), showOverlay && teleport] }));
28
46
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yakad/ui",
3
- "version": "1.3.143",
3
+ "version": "1.3.145",
4
4
  "private": false,
5
5
  "author": "Natiq",
6
6
  "description": "UI components for NextJS/React",