npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@zohodesk/hooks

v2.0.4

Published

Unified Component Library - Hooks

Downloads

1,208

Readme

#UNIFIED COMPONENTS LIBRARY - Hooks

In this package, We provide below react hooks for components development.

  • useAccordion
  • useAccordionHeight
  • useAvatar
  • useDateTime
  • useCalendar
  • useTime
  • useEventListener
  • useFileUpload
  • useFloating
  • useMediaViewer
  • useModal
  • useMultiselect
  • useMultiselectCategory
  • useNotificationBadge
  • usePagination
  • usePopup
  • useAdvancedPopup
  • useRadio
  • useSelect
  • useSelectSearch
  • useSelectControl
  • useSwitch
  • useSelectTab
  • useTextArea
  • useTextBox
  • useClickOutside
  • useCommonReducer
  • useContainerQuery
  • useEffectCallOnlyAfterState
  • useElementResize
  • useEscape
  • useEscapeEffect
  • useEvent
  • useId
  • useMediaQuery
  • useMergeState
  • useMergeStyle
  • usePrevious
  • useIntersectionObserver
  • useResizeObserver
  • useScrollEnd
  • useScrollParents
  • useScrollStopper
  • useTimeout
  • useWindowResize

2.0.4

  • useEventListener - New hook added

2.0.3

  • useMergeState - New hook added

2.0.2

  • useEffectCallOnlyAfterState - Cleanup option provided as third argument
  • useIntersectionObserver - Changing isStartIntersecting will reinitiate the observer
  • useIntersectionObserverGroup - New hook added

2.0.1

  • useResizeObserver issue fix
  • useList deprecated
  • useMultiselectCatogory arguments and return values has been updated
// Before
const { selectedValues, searchStr, ...otherData } = useMultiselectCatogory({
    options: [],
    selectedValues: [],
    selectedGroup: ''
});

// After
const { selectedOptions, searchString, ...otherData } = useMultiselectCatogory({
    options: [],
    selectedOptions: [],
    selectedGroup: ''
});
  • useFileUpload "getRef" argument removed. handleFocus method added.
  • useElementResize will not return "width". Introduced "resizeType" and "needContainerSizeChange" props.
// Before
const { setContainerRef, setBarRef, width } = useElementResize({
    minWidth: 300,
    handleResizeCallback: () => {}
});

// After
const { setContainerRef, setBarRef } = useElementResize({
    minHeight: 100,
    maxHeight: 500,
    minWidth: 100,
    maxWidth: 500,
    resizeType: 'both' || 'height' || 'width',
    handleResizeCallback: () => {},
    needContainerSizeChange: true || false
});

2.0.0

Newly Introduced

  • useAdvancedPopup
  • useSelectSearch
  • useIntersectionObserver

Removed

  • useGlobalEscape
  • EscapeContext
  • EscapeProvider
  • ResizeObserverProvider
  • useVisibleOnPage

Updated

  • useEscape arguments structure has been updated. And No provider is needed to use the escape functionalities with the order.
// Before
useEscape(callback, isRegister);

// After
useEscape({
    callback: () => {},
    isRegister: true
});
  • useFloating arguments is updated. Now you have to give a function which should return element ref.
  • useFloating return value is also updated. Now, this returns a function that will returns the popup position related data.
// Before
const { ...floatingData, handlePosition } = useFloating(containerEleRef, floatingEleRef, options);

// After
const getFloating = useFloating(() => containerEleRef, () => floatingEleRef, options);

const { view, views, viewsOffset, targetOffset, popupOffset, relativeOffset, relativePosition, popupPosition } = getFloating();
  • useClickOutside arguments structure has been updated
// Before
useClickOutside({
    element: elementRef,
    callback: () => {}
});

// After
useClickOutside({
    getElements: () => [element1_Ref, element2_Ref],
    callback: () => {},
    isRegister: true
});
  • useScrollStopper arguments has been updated.
// Before
useScrollStopper({
    element: elementRef,
    excludeElement: excludeElementRef,
    isStop: false
});

// After
useScrollStopper({
    element: elementRef,
    getExcludeElements: () => [excludeElement1_Ref, excludeElement2_Ref],
    isStop: false
});
  • useContainerQuery arguments is updated. Now you have to give a function which should return element ref.
  • useContainerQuery return value is also updated. Now, this returns only the matched query object.
// Before
const [elementRef, matchedQuery] = useContainerQuery(query, options);

// After
const matchedQuery = useContainerQuery(() => elementRef, query, options);
  • useResizeObserver arguments is updated
// Before
useResizeObserver({
    element: elementRef
    callback: () => {}
});

// After
useResizeObserver({
    getElement: () => elementRef,
    callback: () => {},
    isObserve: true
});
  • useWindowResize - Removed the resize handler from useEffect dependency