Comparing version 11.19.0 to 11.20.0
@@ -6,3 +6,6 @@ import React, { ReactNode } from "react"; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function Hide(props: HideProps): React.JSX.Element | null; | ||
export {}; |
@@ -8,2 +8,5 @@ "use strict"; | ||
const react_1 = __importDefault(require("react")); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function Hide(props) { | ||
@@ -10,0 +13,0 @@ if (props.when) { |
@@ -6,3 +6,6 @@ import React, { ReactNode } from "react"; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function Show(props: ShowProps): React.JSX.Element | null; | ||
export {}; |
@@ -8,2 +8,5 @@ "use strict"; | ||
const react_1 = __importDefault(require("react")); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function Show(props) { | ||
@@ -10,0 +13,0 @@ if (!props.when) { |
@@ -11,2 +11,5 @@ import { KeyboardEventHandler, MouseEventHandler } from "react"; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function _useSimulatedButton<T extends HTMLElement>({ analyticsCallback, isClickable, isHyperlink, onClick, onKeyDown, onKeyUp, submit, }: Props<T>): { | ||
@@ -13,0 +16,0 @@ onClick: MouseEventHandler<T>; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function _useSimulatedButton({ analyticsCallback, isClickable, isHyperlink, onClick, onKeyDown, onKeyUp, submit, }) { | ||
@@ -7,0 +10,0 @@ const _onClick = (0, react_1.useCallback)((e) => { |
import { AnchorHTMLAttributes } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export interface UseAnchorProps { | ||
@@ -8,2 +11,5 @@ analyticsCallback?: () => void; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useAnchorProps<T extends AnchorHTMLAttributes<HTMLAnchorElement>>({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, disabled, download, href, hrefLang, loading, media, onClick, onKeyDown, onKeyUp, ping, referrerPolicy, rel, role, tabIndex, target, type, ...restProps }: UseAnchorProps & T): T; |
@@ -7,2 +7,5 @@ "use strict"; | ||
const _useSimulatedButton_1 = require("./_useSimulatedButton"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useAnchorProps({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, disabled, download, href, hrefLang, loading, media, onClick, onKeyDown, onKeyUp, ping, referrerPolicy, rel, role, tabIndex, target, type, ...restProps }) { | ||
@@ -9,0 +12,0 @@ const isBusy = loading ? loading : Boolean(ariaBusy); |
import { RefObject } from "react"; | ||
import { BodyScrollOptions } from "../utils/bodyScrollLock"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export interface UseBodyScrollLockOptions extends BodyScrollOptions { | ||
clearAllOnClose?: boolean; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useBodyScrollLock<T extends HTMLElement>(containerRef: RefObject<T>, isOpen: boolean, { allowTouchMove, clearAllOnClose, reserveScrollBarGap }?: Partial<UseBodyScrollLockOptions>): void; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const bodyScrollLock_1 = require("../utils/bodyScrollLock"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useBodyScrollLock(containerRef, isOpen, { allowTouchMove, clearAllOnClose, reserveScrollBarGap } = {}) { | ||
@@ -8,0 +11,0 @@ (0, react_1.useEffect)(() => { |
import { ButtonHTMLAttributes } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export interface UseButtonProps { | ||
@@ -6,2 +9,5 @@ analyticsCallback?: () => void; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useButtonProps<T extends ButtonHTMLAttributes<HTMLButtonElement>>({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, autoFocus, analyticsCallback, className, disabled, formAction, formEncType, formMethod, formNoValidate, formTarget, loading, name, onClick, role, tabIndex, type, value, ...restProps }: UseButtonProps & T): T; |
@@ -7,2 +7,5 @@ "use strict"; | ||
const cx_1 = require("../utils/cx"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useButtonProps({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, autoFocus, analyticsCallback, className, disabled, formAction, formEncType, formMethod, formNoValidate, formTarget, loading, name, onClick, role, tabIndex, type, value, ...restProps }) { | ||
@@ -9,0 +12,0 @@ const isBusy = loading ? loading : Boolean(ariaBusy); |
import { HTMLAttributes } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export interface UseClickableProps { | ||
@@ -8,2 +11,5 @@ analyticsCallback?: () => void; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useClickableProps<T extends HTMLAttributes<HTMLElement>>({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, disabled, loading, onClick, onKeyDown, onKeyUp, role, tabIndex, type, ...restProps }: UseClickableProps & T): T; |
@@ -7,2 +7,5 @@ "use strict"; | ||
const _useSimulatedButton_1 = require("./_useSimulatedButton"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useClickableProps({ ["aria-busy"]: ariaBusy, ["aria-disabled"]: ariaDisabled, analyticsCallback, className, disabled, loading, onClick, onKeyDown, onKeyUp, role, tabIndex, type, ...restProps }) { | ||
@@ -9,0 +12,0 @@ const isBusy = loading ? loading : Boolean(ariaBusy); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useFocusReturn(opened: boolean, transitionDuration?: number, shouldReturnFocus?: boolean): () => void; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const useOnUpdate_1 = require("./useOnUpdate"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useFocusReturn(opened, transitionDuration = 0, shouldReturnFocus = true) { | ||
@@ -8,0 +11,0 @@ const lastActiveElement = (0, react_1.useRef)(); |
import { RefCallback } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useFocusTrap<T extends HTMLElement>(active?: boolean): RefCallback<T>; |
@@ -88,2 +88,5 @@ "use strict"; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useFocusTrap(active = true) { | ||
@@ -90,0 +93,0 @@ const ref = (0, react_1.useRef)(); |
import { FocusEventHandler, MouseEventHandler, RefObject } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useInputFocus<T extends HTMLInputElement | HTMLTextAreaElement | HTMLElement>(focusRef: RefObject<T>, onBlur?: FocusEventHandler<T>, onFocus?: FocusEventHandler<T>): { | ||
@@ -3,0 +6,0 @@ focused: boolean; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useInputFocus(focusRef, onBlur, onFocus) { | ||
@@ -7,0 +10,0 @@ const [focused, setFocused] = (0, react_1.useState)(false); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useIsMounted(): boolean; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useIsMounted() { | ||
@@ -7,0 +10,0 @@ const [isMounted, setIsMounted] = (0, react_1.useState)(false); |
import { useEffect } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare const useIsomorphicLayoutEffect: typeof useEffect; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const isBrowser_1 = require("../utils/isBrowser"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
exports.useIsomorphicLayoutEffect = isBrowser_1.isBrowser ? react_1.useLayoutEffect : react_1.useEffect; |
import { RefObject } from "react"; | ||
type KeyPredicate = (e: KeyboardEvent) => boolean; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export type KeyFilter = null | undefined | string | KeyPredicate; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export interface UseKeyOptions<T extends HTMLElement> { | ||
@@ -9,3 +15,6 @@ disabled?: boolean; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useKey<T extends HTMLElement>(keyFilter: KeyFilter, callback: (e: KeyboardEvent) => void, { disabled, targetRef, type }?: Partial<UseKeyOptions<T>>): void; | ||
export {}; |
@@ -10,2 +10,5 @@ "use strict"; | ||
: () => false; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useKey(keyFilter, callback, { disabled, targetRef, type = "keydown" } = {}) { | ||
@@ -12,0 +15,0 @@ (0, react_1.useEffect)(() => { |
/// <reference types="react" /> | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useLatest<T>(current: T): import("react").MutableRefObject<T>; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useLatest(current) { | ||
@@ -7,0 +10,0 @@ const storedValue = (0, react_1.useRef)(current); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useMinWindowWidth(minWidth: number, debounce?: number): boolean | undefined; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const useRafState_1 = require("./useRafState"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useMinWindowWidth(minWidth, debounce = 0) { | ||
@@ -8,0 +11,0 @@ const [state, setState] = (0, useRafState_1.useRafState)(); |
import { CSSProperties, RefObject } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useMouseDragToScroll<T extends HTMLElement>(containerRef: RefObject<T>): CSSProperties | undefined; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useMouseDragToScroll(containerRef) { | ||
@@ -7,0 +10,0 @@ const position = (0, react_1.useRef)({ left: 0, top: 0, x: 0, y: 0 }); |
import { EffectCallback } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useOnMount(effect: EffectCallback): void; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useOnMount(effect) { | ||
@@ -7,0 +10,0 @@ (0, react_1.useEffect)(() => { |
import { EffectCallback } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useOnUnmount(effect: EffectCallback): void; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useOnUnmount(effect) { | ||
@@ -7,0 +10,0 @@ const effectRef = (0, react_1.useRef)(effect); |
import { DependencyList, EffectCallback } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useOnUpdate(effect: EffectCallback, deps: DependencyList): void; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useOnUpdate(effect, deps) { | ||
@@ -7,0 +10,0 @@ const firstRun = (0, react_1.useRef)(true); |
import { PaginationConfig, PaginationItem } from "../utils/pagination"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare const usePagination: (config: PaginationConfig) => PaginationItem[]; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const pagination_1 = require("../utils/pagination"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
const usePagination = (config) => { | ||
@@ -8,0 +11,0 @@ return (0, react_1.useMemo)(() => (0, pagination_1.paginationGenerate)(config), |
/// <reference types="react" /> | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function usePrevious<T>(current: T): import("react").MutableRefObject<T>; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const react_1 = require("react"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function usePrevious(current) { | ||
@@ -7,0 +10,0 @@ const storedValue = (0, react_1.useRef)(current); |
import { Dispatch, SetStateAction } from "react"; | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useRafState<S = undefined>(initialState?: S | (() => S)): [S | undefined, Dispatch<SetStateAction<S | undefined>>]; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const useOnUnmount_1 = require("./useOnUnmount"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useRafState(initialState) { | ||
@@ -8,0 +11,0 @@ const frame = (0, react_1.useRef)(0); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useWindowScroll(): { | ||
@@ -2,0 +5,0 @@ x: number; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const useRafState_1 = require("./useRafState"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useWindowScroll() { | ||
@@ -8,0 +11,0 @@ const [state, setState] = (0, useRafState_1.useRafState)(); |
@@ -0,1 +1,4 @@ | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
export declare function useWindowSize(): { | ||
@@ -2,0 +5,0 @@ width: number; |
@@ -6,2 +6,5 @@ "use strict"; | ||
const useRafState_1 = require("./useRafState"); | ||
/** | ||
* @deprecated Use import from @uxf/core-react instead. | ||
*/ | ||
function useWindowSize() { | ||
@@ -8,0 +11,0 @@ const [state, setState] = (0, useRafState_1.useRafState)(); |
{ | ||
"name": "@uxf/core", | ||
"version": "11.19.0", | ||
"version": "11.20.0", | ||
"description": "UXF Core", | ||
@@ -5,0 +5,0 @@ "author": "Petr Vejvoda <vejvoda@uxf.cz>", |
@@ -77,3 +77,3 @@ # UXF Core | ||
## Hooks | ||
## Hooks - @deprecated - will be moved to @uxf/core-react | ||
@@ -80,0 +80,0 @@ ```tsx |
import { FC } from "react"; | ||
import { ImageSource, ResizerImageProps } from "./resizer"; | ||
import { ImageResponse, ImageSource, ResizerImageProps, StaticImageData } from "./resizer"; | ||
export type Dimension = number | "auto"; | ||
export type Format = "avif" | "webp" | "original"; | ||
export type Quality = number | Record<Format, number>; | ||
export declare function toImageResponse(src: any): ImageResponse | undefined; | ||
export declare function toStaticImageData(src: any): StaticImageData | undefined; | ||
export declare function parseImgExtension(src: string): string | undefined; | ||
export declare function getSvgImgUrl(src: ImageSource): string | undefined; | ||
@@ -15,2 +18,5 @@ export declare function getImgQuality(quality: Quality | undefined, format: Format): number | undefined; | ||
export declare function getImgSrcSet(src?: ImageSource, width?: Dimension, height?: Dimension, options?: GetImgSrcSetOptions): string | undefined; | ||
/** | ||
* @deprecated Use import from @uxf/ui instead. | ||
*/ | ||
export type ImageSourcesOptions = Omit<GetImgSrcSetOptions, "quality" | "toFormat"> & { | ||
@@ -29,3 +35,6 @@ isAvifDisabled?: boolean; | ||
} | ||
/** | ||
* @deprecated Use import from @uxf/ui instead. | ||
*/ | ||
export declare const ImgSources: FC<ImageSourcesProps>; | ||
export {}; |
@@ -6,5 +6,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ImgSources = exports.getImgSrcSet = exports.getImgElementWidth = exports.getImgElementHeight = exports.getImgUniqueIdentifier = exports.getImgQuality = exports.getSvgImgUrl = void 0; | ||
exports.ImgSources = exports.getImgSrcSet = exports.getImgElementWidth = exports.getImgElementHeight = exports.getImgUniqueIdentifier = exports.getImgQuality = exports.getSvgImgUrl = exports.parseImgExtension = exports.toStaticImageData = exports.toImageResponse = void 0; | ||
const hide_1 = require("@uxf/core-react/components/hide"); | ||
const react_1 = __importDefault(require("react")); | ||
const hide_1 = require("../components/hide"); | ||
const file_1 = require("./file"); | ||
@@ -15,5 +15,7 @@ const resizer_1 = require("./resizer"); | ||
} | ||
exports.toImageResponse = toImageResponse; | ||
function toStaticImageData(src) { | ||
return typeof src !== "string" && "src" in src ? src : undefined; | ||
} | ||
exports.toStaticImageData = toStaticImageData; | ||
function parseImgExtension(src) { | ||
@@ -23,2 +25,3 @@ const ext = src.slice(src.lastIndexOf(".") + 1); | ||
} | ||
exports.parseImgExtension = parseImgExtension; | ||
function getSvgImgUrl(src) { | ||
@@ -104,2 +107,5 @@ if (typeof src === "string" && parseImgExtension(src) === "svg") { | ||
exports.getImgSrcSet = getImgSrcSet; | ||
/** | ||
* @deprecated Use import from @uxf/ui instead. | ||
*/ | ||
const ImgSources = (props) => { | ||
@@ -106,0 +112,0 @@ var _a, _b, _c, _d, _e; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
108961
2508