@koine/react 2.0.0-beta.21 → 2.0.0-beta.211
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/FaviconTags.cjs.default.js +1 -0
- package/FaviconTags.cjs.js +10 -0
- package/FaviconTags.cjs.mjs +2 -0
- package/FaviconTags.d.ts +11 -1
- package/FaviconTags.esm.js +5 -0
- package/Meta.cjs.default.js +1 -0
- package/Meta.cjs.js +10 -0
- package/Meta.cjs.mjs +2 -0
- package/Meta.d.ts +11 -1
- package/Meta.esm.js +5 -0
- package/NoJs.cjs.default.js +1 -0
- package/NoJs.cjs.js +10 -0
- package/NoJs.cjs.mjs +2 -0
- package/NoJs.d.ts +2 -2
- package/NoJs.esm.js +5 -0
- package/Polymorphic.cjs.default.js +1 -0
- package/Polymorphic.cjs.js +2 -0
- package/Polymorphic.cjs.mjs +2 -0
- package/Polymorphic.d.ts +40 -0
- package/Polymorphic.esm.js +1 -0
- package/README.md +1 -0
- package/calendar/CalendarDaygridCell.cjs.js +9 -0
- package/{Calendar → calendar}/CalendarDaygridCell.d.ts +4 -4
- package/calendar/CalendarDaygridCell.esm.js +7 -0
- package/calendar/CalendarDaygridNav.cjs.js +9 -0
- package/{Calendar → calendar}/CalendarDaygridNav.d.ts +3 -3
- package/calendar/CalendarDaygridNav.esm.js +7 -0
- package/calendar/CalendarDaygridTable.cjs.js +13 -0
- package/{Calendar → calendar}/CalendarDaygridTable.d.ts +4 -4
- package/calendar/CalendarDaygridTable.esm.js +11 -0
- package/calendar/CalendarLegend.cjs.js +7 -0
- package/{Calendar → calendar}/CalendarLegend.d.ts +3 -3
- package/calendar/CalendarLegend.esm.js +5 -0
- package/calendar/calendar-api-google.cjs.js +10 -0
- package/calendar/calendar-api-google.d.ts +18 -0
- package/calendar/calendar-api-google.esm.js +8 -0
- package/{Calendar → calendar}/types.d.ts +19 -0
- package/calendar/useCalendar.cjs.js +9 -0
- package/{Calendar → calendar}/useCalendar.d.ts +19 -5
- package/calendar/useCalendar.esm.js +7 -0
- package/calendar/useDateLocale.cjs.js +7 -0
- package/calendar/useDateLocale.d.ts +8 -0
- package/calendar/useDateLocale.esm.js +5 -0
- package/calendar/utils.cjs.js +23 -0
- package/calendar/utils.d.ts +11 -0
- package/calendar/utils.esm.js +13 -0
- package/calendar.cjs.default.js +1 -0
- package/calendar.cjs.js +17 -0
- package/calendar.cjs.mjs +2 -0
- package/calendar.d.ts +7 -0
- package/calendar.esm.js +6 -0
- package/classed.cjs.default.js +1 -0
- package/classed.cjs.js +10 -0
- package/classed.cjs.mjs +2 -0
- package/classed.d.ts +21 -2
- package/classed.esm.js +5 -0
- package/createUseMediaQueryWidth.cjs.default.js +1 -0
- package/createUseMediaQueryWidth.cjs.js +12 -0
- package/createUseMediaQueryWidth.cjs.mjs +2 -0
- package/createUseMediaQueryWidth.d.ts +7 -1
- package/createUseMediaQueryWidth.esm.js +7 -0
- package/extendComponent.cjs.default.js +1 -0
- package/extendComponent.cjs.js +10 -0
- package/extendComponent.cjs.mjs +2 -0
- package/extendComponent.d.ts +13 -2
- package/extendComponent.esm.js +5 -0
- package/forms/antispam.cjs.js +9 -0
- package/forms/antispam.d.ts +47 -0
- package/forms/antispam.esm.js +6 -0
- package/forms.cjs.default.js +1 -0
- package/forms.cjs.js +8 -0
- package/forms.cjs.mjs +2 -0
- package/forms.d.ts +1 -0
- package/forms.esm.js +1 -0
- package/index.cjs.default.js +1 -0
- package/index.cjs.js +57 -0
- package/index.cjs.mjs +2 -0
- package/index.d.ts +28 -25
- package/index.esm.js +26 -0
- package/mergeRefs.cjs.default.js +1 -0
- package/mergeRefs.cjs.js +8 -0
- package/mergeRefs.cjs.mjs +2 -0
- package/mergeRefs.d.ts +1 -2
- package/mergeRefs.esm.js +3 -0
- package/package.json +147 -579
- package/types.cjs.default.js +1 -0
- package/types.cjs.js +2 -0
- package/types.cjs.mjs +2 -0
- package/types.d.ts +1 -9
- package/types.esm.js +1 -0
- package/useAsyncFn.cjs.default.js +1 -0
- package/useAsyncFn.cjs.js +11 -0
- package/useAsyncFn.cjs.mjs +2 -0
- package/useAsyncFn.d.ts +6 -2
- package/useAsyncFn.esm.js +6 -0
- package/useFirstMountState.cjs.default.js +1 -0
- package/useFirstMountState.cjs.js +10 -0
- package/useFirstMountState.cjs.mjs +2 -0
- package/useFirstMountState.d.ts +4 -1
- package/useFirstMountState.esm.js +5 -0
- package/useFixedOffset.cjs.default.js +1 -0
- package/useFixedOffset.cjs.js +13 -0
- package/useFixedOffset.cjs.mjs +2 -0
- package/useFixedOffset.d.ts +10 -2
- package/useFixedOffset.esm.js +8 -0
- package/useFocus.cjs.default.js +1 -0
- package/useFocus.cjs.js +10 -0
- package/useFocus.cjs.mjs +2 -0
- package/useFocus.d.ts +4 -2
- package/useFocus.esm.js +5 -0
- package/useInterval.cjs.default.js +1 -0
- package/useInterval.cjs.js +11 -0
- package/useInterval.cjs.mjs +2 -0
- package/useInterval.d.ts +6 -1
- package/useInterval.esm.js +6 -0
- package/useIsomorphicLayoutEffect.cjs.default.js +1 -0
- package/useIsomorphicLayoutEffect.cjs.js +11 -0
- package/useIsomorphicLayoutEffect.cjs.mjs +2 -0
- package/useIsomorphicLayoutEffect.d.ts +4 -1
- package/useIsomorphicLayoutEffect.esm.js +6 -0
- package/useKeyUp.cjs.default.js +1 -0
- package/useKeyUp.cjs.js +11 -0
- package/useKeyUp.cjs.mjs +2 -0
- package/useKeyUp.d.ts +1 -1
- package/useKeyUp.esm.js +6 -0
- package/useMeasure.cjs.default.js +1 -0
- package/useMeasure.cjs.js +12 -0
- package/useMeasure.cjs.mjs +2 -0
- package/useMeasure.d.ts +6 -1
- package/useMeasure.esm.js +7 -0
- package/useMountedState.cjs.default.js +1 -0
- package/useMountedState.cjs.js +10 -0
- package/useMountedState.cjs.mjs +2 -0
- package/useMountedState.d.ts +4 -1
- package/useMountedState.esm.js +5 -0
- package/useNavigateAway.cjs.default.js +1 -0
- package/useNavigateAway.cjs.js +11 -0
- package/useNavigateAway.cjs.mjs +2 -0
- package/useNavigateAway.d.ts +30 -1
- package/useNavigateAway.esm.js +6 -0
- package/usePrevious.cjs.default.js +1 -0
- package/usePrevious.cjs.js +10 -0
- package/usePrevious.cjs.mjs +2 -0
- package/usePrevious.d.ts +4 -1
- package/usePrevious.esm.js +5 -0
- package/usePreviousRef.cjs.default.js +1 -0
- package/usePreviousRef.cjs.js +10 -0
- package/usePreviousRef.cjs.mjs +2 -0
- package/usePreviousRef.d.ts +1 -1
- package/usePreviousRef.esm.js +5 -0
- package/useReveal.d.ts +34 -0
- package/useScrollPosition.cjs.default.js +1 -0
- package/useScrollPosition.cjs.js +13 -0
- package/useScrollPosition.cjs.mjs +2 -0
- package/useScrollPosition.d.ts +8 -2
- package/useScrollPosition.esm.js +8 -0
- package/useScrollThreshold.cjs.default.js +1 -0
- package/useScrollThreshold.cjs.js +12 -0
- package/useScrollThreshold.cjs.mjs +2 -0
- package/useScrollThreshold.d.ts +1 -1
- package/useScrollThreshold.esm.js +7 -0
- package/useScrollTo.cjs.default.js +1 -0
- package/useScrollTo.cjs.js +10 -0
- package/useScrollTo.cjs.mjs +2 -0
- package/useScrollTo.d.ts +1 -1
- package/useScrollTo.esm.js +5 -0
- package/useSmoothScroll.cjs.default.js +1 -0
- package/useSmoothScroll.cjs.js +13 -0
- package/useSmoothScroll.cjs.mjs +2 -0
- package/useSmoothScroll.d.ts +7 -1
- package/useSmoothScroll.esm.js +8 -0
- package/useSpinDelay.cjs.default.js +1 -0
- package/useSpinDelay.cjs.js +10 -0
- package/useSpinDelay.cjs.mjs +2 -0
- package/useSpinDelay.d.ts +13 -1
- package/useSpinDelay.esm.js +5 -0
- package/useTraceUpdate.cjs.default.js +1 -0
- package/useTraceUpdate.cjs.js +10 -0
- package/useTraceUpdate.cjs.mjs +2 -0
- package/useTraceUpdate.d.ts +4 -1
- package/useTraceUpdate.esm.js +5 -0
- package/useUpdateEffect.cjs.default.js +1 -0
- package/useUpdateEffect.cjs.js +11 -0
- package/useUpdateEffect.cjs.mjs +2 -0
- package/useUpdateEffect.d.ts +4 -1
- package/useUpdateEffect.esm.js +6 -0
- package/useWindowSize.cjs.default.js +1 -0
- package/useWindowSize.cjs.js +11 -0
- package/useWindowSize.cjs.mjs +2 -0
- package/useWindowSize.d.ts +11 -2
- package/useWindowSize.esm.js +6 -0
- package/vite.config.d.ts +2 -0
- package/Alert/Alert.d.ts +0 -5
- package/Alert/Alert.js +0 -10
- package/Alert/index.d.ts +0 -1
- package/Alert/index.js +0 -1
- package/Animations/Reveal.d.ts +0 -3
- package/Animations/Reveal.js +0 -16
- package/Animations/Underline.d.ts +0 -1
- package/Animations/Underline.js +0 -5
- package/Animations/index.d.ts +0 -3
- package/Animations/index.js +0 -3
- package/Animations/useReveal.d.ts +0 -13
- package/Animations/useReveal.js +0 -43
- package/Autocomplete/AutocompleteDownshift.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshift.js +0 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.d.ts +0 -1
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +0 -1
- package/Autocomplete/AutocompleteMui.d.ts +0 -22
- package/Autocomplete/AutocompleteMui.js +0 -93
- package/Autocomplete/AutocompleteReach.d.ts +0 -1
- package/Autocomplete/AutocompleteReach.js +0 -1
- package/Autocomplete/components.d.ts +0 -12
- package/Autocomplete/components.js +0 -26
- package/Autocomplete/helpers.d.ts +0 -3
- package/Autocomplete/helpers.js +0 -16
- package/Autocomplete/index.d.ts +0 -2
- package/Autocomplete/index.js +0 -1
- package/Bg/BgColor.d.ts +0 -12
- package/Bg/BgColor.js +0 -16
- package/Bg/BgPhoto.d.ts +0 -8
- package/Bg/BgPhoto.js +0 -16
- package/Bg/BgSvg.d.ts +0 -4
- package/Bg/BgSvg.js +0 -9
- package/Bg/index.d.ts +0 -3
- package/Bg/index.js +0 -3
- package/Breadcrumbs/Breadcrumbs.d.ts +0 -13
- package/Breadcrumbs/Breadcrumbs.js +0 -27
- package/Breadcrumbs/index.d.ts +0 -1
- package/Breadcrumbs/index.js +0 -1
- package/Buttons/Button.d.ts +0 -14
- package/Buttons/Button.js +0 -10
- package/Buttons/ButtonComposite.d.ts +0 -22
- package/Buttons/ButtonComposite.js +0 -28
- package/Buttons/ButtonFab.d.ts +0 -4
- package/Buttons/ButtonFab.js +0 -6
- package/Buttons/ButtonLink.d.ts +0 -8
- package/Buttons/ButtonLink.js +0 -11
- package/Buttons/IconButton.d.ts +0 -8
- package/Buttons/IconButton.js +0 -7
- package/Buttons/index.d.ts +0 -5
- package/Buttons/index.js +0 -5
- package/Calendar/CalendarDaygridCell.js +0 -46
- package/Calendar/CalendarDaygridNav.js +0 -24
- package/Calendar/CalendarDaygridTable.js +0 -45
- package/Calendar/CalendarLegend.js +0 -9
- package/Calendar/calendar-api-google.d.ts +0 -10
- package/Calendar/calendar-api-google.js +0 -124
- package/Calendar/index.d.ts +0 -6
- package/Calendar/index.js +0 -6
- package/Calendar/types.js +0 -1
- package/Calendar/useCalendar.js +0 -176
- package/Calendar/utils.d.ts +0 -11
- package/Calendar/utils.js +0 -185
- package/Carousel/Carousel.d.ts +0 -1
- package/Carousel/Carousel.js +0 -1
- package/Carousel/CarouselCss.d.ts +0 -13
- package/Carousel/CarouselCss.js +0 -19
- package/Carousel/index.d.ts +0 -1
- package/Carousel/index.js +0 -1
- package/Collapsable/Collapsable.d.ts +0 -1
- package/Collapsable/Collapsable.js +0 -1
- package/Collapsable/CollapsableReach.d.ts +0 -0
- package/Collapsable/CollapsableReach.js +0 -1
- package/Collapsable/index.d.ts +0 -1
- package/Collapsable/index.js +0 -1
- package/Debug/Debug.d.ts +0 -4
- package/Debug/Debug.js +0 -9
- package/Debug/index.d.ts +0 -1
- package/Debug/index.js +0 -1
- package/Details/Details.d.ts +0 -398
- package/Details/Details.js +0 -52
- package/Details/index.d.ts +0 -1
- package/Details/index.js +0 -1
- package/Dialog/DialogMui.d.ts +0 -165
- package/Dialog/DialogMui.js +0 -39
- package/Dialog/css/bare.d.ts +0 -171
- package/Dialog/css/bare.js +0 -21
- package/Dialog/index.d.ts +0 -2
- package/Dialog/index.js +0 -1
- package/Dialog/m/bare.d.ts +0 -4
- package/Dialog/m/bare.js +0 -3
- package/Dialog/m/basic.d.ts +0 -4
- package/Dialog/m/basic.js +0 -28
- package/Dialog/m/index.d.ts +0 -2
- package/Dialog/m/index.js +0 -4
- package/Dialog/sc/bare.d.ts +0 -61
- package/Dialog/sc/bare.js +0 -31
- package/Dialog/sc/framer.d.ts +0 -24
- package/Dialog/sc/framer.js +0 -16
- package/Dialog/sc/framerMaterial.d.ts +0 -24
- package/Dialog/sc/framerMaterial.js +0 -16
- package/Dialog/sc/material.d.ts +0 -60
- package/Dialog/sc/material.js +0 -21
- package/Dialog/tw/bare.d.ts +0 -208
- package/Dialog/tw/bare.js +0 -29
- package/Dialog/tw/elegant.d.ts +0 -270
- package/Dialog/tw/elegant.js +0 -21
- package/Dialog/tw/framer.d.ts +0 -108
- package/Dialog/tw/framer.js +0 -16
- package/Dialog/tw/framerMaterial.d.ts +0 -164
- package/Dialog/tw/framerMaterial.js +0 -16
- package/Dialog/tw/material.d.ts +0 -270
- package/Dialog/tw/material.js +0 -21
- package/Editor/Editor--tiptap.d.ts +0 -9
- package/Editor/Editor--tiptap.js +0 -26
- package/Editor/components.d.ts +0 -5
- package/Editor/components.js +0 -10
- package/Editor/index.d.ts +0 -1
- package/Editor/index.js +0 -1
- package/FaviconTags.js +0 -6
- package/Form/Form.d.ts +0 -125
- package/Form/Form.js +0 -60
- package/Form/index.d.ts +0 -1
- package/Form/index.js +0 -1
- package/Form/sc/bare.d.ts +0 -57
- package/Form/sc/bare.js +0 -20
- package/Forms/Checkbox/Checkbox.d.ts +0 -7
- package/Forms/Checkbox/Checkbox.js +0 -15
- package/Forms/Checkbox/index.d.ts +0 -1
- package/Forms/Checkbox/index.js +0 -1
- package/Forms/Feedback/Feedback.d.ts +0 -5
- package/Forms/Feedback/Feedback.js +0 -9
- package/Forms/Feedback/index.d.ts +0 -1
- package/Forms/Feedback/index.js +0 -1
- package/Forms/Field/Field.d.ts +0 -18
- package/Forms/Field/Field.js +0 -25
- package/Forms/Field/FieldControl.d.ts +0 -14
- package/Forms/Field/FieldControl.js +0 -35
- package/Forms/Field/FieldHint.d.ts +0 -1
- package/Forms/Field/FieldHint.js +0 -4
- package/Forms/Field/index.d.ts +0 -2
- package/Forms/Field/index.js +0 -2
- package/Forms/Input/Input.d.ts +0 -8
- package/Forms/Input/Input.js +0 -16
- package/Forms/Input/index.d.ts +0 -1
- package/Forms/Input/index.js +0 -1
- package/Forms/InputGroup/InputGroup.d.ts +0 -12
- package/Forms/InputGroup/InputGroup.js +0 -15
- package/Forms/InputGroup/index.d.ts +0 -1
- package/Forms/InputGroup/index.js +0 -1
- package/Forms/Label/Label.d.ts +0 -3
- package/Forms/Label/Label.js +0 -6
- package/Forms/Label/index.d.ts +0 -1
- package/Forms/Label/index.js +0 -1
- package/Forms/Password/Password.d.ts +0 -4
- package/Forms/Password/Password.js +0 -17
- package/Forms/Password/index.d.ts +0 -1
- package/Forms/Password/index.js +0 -1
- package/Forms/Radio/Radio.d.ts +0 -11
- package/Forms/Radio/Radio.js +0 -25
- package/Forms/Radio/index.d.ts +0 -1
- package/Forms/Radio/index.js +0 -1
- package/Forms/Switch/Switch.d.ts +0 -5
- package/Forms/Switch/Switch.js +0 -17
- package/Forms/Switch/index.d.ts +0 -1
- package/Forms/Switch/index.js +0 -1
- package/Forms/Textarea/Textarea.d.ts +0 -4
- package/Forms/Textarea/Textarea.js +0 -12
- package/Forms/Textarea/TextareaRich.d.ts +0 -5
- package/Forms/Textarea/TextareaRich.js +0 -26
- package/Forms/Textarea/index.d.ts +0 -2
- package/Forms/Textarea/index.js +0 -2
- package/Forms/Toggle/Toggle-tailwind.d.ts +0 -0
- package/Forms/Toggle/Toggle-tailwind.js +0 -1
- package/Forms/Toggle/Toggle.d.ts +0 -18
- package/Forms/Toggle/Toggle.js +0 -25
- package/Forms/Toggle/index.d.ts +0 -1
- package/Forms/Toggle/index.js +0 -1
- package/Forms/Toggle/useToggle-tailwind.d.ts +0 -0
- package/Forms/Toggle/useToggle-tailwind.js +0 -1
- package/Forms/Toggle/useToggle.d.ts +0 -16
- package/Forms/Toggle/useToggle.js +0 -85
- package/Forms/antispam.d.ts +0 -27
- package/Forms/antispam.js +0 -29
- package/Forms/helpers.d.ts +0 -18
- package/Forms/helpers.js +0 -35
- package/Forms/index.d.ts +0 -15
- package/Forms/index.js +0 -15
- package/Forms/styles.d.ts +0 -9
- package/Forms/styles.js +0 -19
- package/Gauge/Gauge.d.ts +0 -4
- package/Gauge/Gauge.js +0 -1
- package/Grid/Grid.d.ts +0 -32
- package/Grid/Grid.js +0 -52
- package/Grid/index.d.ts +0 -1
- package/Grid/index.js +0 -1
- package/Hamburger/Hamburger.d.ts +0 -5
- package/Hamburger/Hamburger.js +0 -47
- package/Hamburger/index.d.ts +0 -1
- package/Hamburger/index.js +0 -1
- package/Header/index.d.ts +0 -1
- package/Header/index.js +0 -1
- package/Header/useHeader.d.ts +0 -20
- package/Header/useHeader.js +0 -32
- package/Hidden/Hidden.d.ts +0 -6
- package/Hidden/Hidden.js +0 -10
- package/Hidden/index.d.ts +0 -1
- package/Hidden/index.js +0 -1
- package/Img/index.d.ts +0 -1
- package/Img/index.js +0 -1
- package/Img/sc/bare.d.ts +0 -2
- package/Img/sc/bare.js +0 -4
- package/Img/types.d.ts +0 -9
- package/Img/types.js +0 -1
- package/Link/Link.d.ts +0 -3
- package/Link/Link.js +0 -4
- package/Link/LinkBlank.d.ts +0 -5
- package/Link/LinkBlank.js +0 -15
- package/Link/index.d.ts +0 -2
- package/Link/index.js +0 -2
- package/Menu/Menu.d.ts +0 -1
- package/Menu/Menu.js +0 -4
- package/Menu/MenuMui.d.ts +0 -0
- package/Menu/MenuMui.js +0 -1
- package/Menu/index.d.ts +0 -1
- package/Menu/index.js +0 -1
- package/MenuItem/MenuItem.d.ts +0 -1
- package/MenuItem/MenuItem.js +0 -4
- package/MenuItem/MenuItemMui.d.ts +0 -0
- package/MenuItem/MenuItemMui.js +0 -1
- package/MenuItem/index.d.ts +0 -1
- package/MenuItem/index.js +0 -1
- package/MenuItem/useMenuItem.d.ts +0 -9
- package/MenuItem/useMenuItem.js +0 -42
- package/Meta.js +0 -6
- package/NoJs.js +0 -7
- package/Pagination/PaginationNav.d.ts +0 -14
- package/Pagination/PaginationNav.js +0 -48
- package/Pagination/PaginationResults.d.ts +0 -3
- package/Pagination/PaginationResults.js +0 -11
- package/Pagination/index.d.ts +0 -2
- package/Pagination/index.js +0 -2
- package/Pill/Pill.d.ts +0 -5
- package/Pill/Pill.js +0 -7
- package/Pill/index.d.ts +0 -1
- package/Pill/index.js +0 -1
- package/Progress/ProgressCircular.d.ts +0 -13
- package/Progress/ProgressCircular.js +0 -12
- package/Progress/ProgressLinear.d.ts +0 -15
- package/Progress/ProgressLinear.js +0 -21
- package/Progress/ProgressOverlay.d.ts +0 -4
- package/Progress/ProgressOverlay.js +0 -23
- package/Progress/index.d.ts +0 -3
- package/Progress/index.js +0 -3
- package/Rating/Rating.d.ts +0 -27
- package/Rating/Rating.js +0 -43
- package/Rating/index.d.ts +0 -8
- package/Rating/index.js +0 -45
- package/Select/SelectDownshift.d.ts +0 -5
- package/Select/SelectDownshift.js +0 -1
- package/Select/components.d.ts +0 -6
- package/Select/components.js +0 -12
- package/Select/index.d.ts +0 -2
- package/Select/index.js +0 -1
- package/Sidebar/Sidebar.d.ts +0 -3
- package/Sidebar/Sidebar.js +0 -23
- package/Sidebar/index.d.ts +0 -1
- package/Sidebar/index.js +0 -1
- package/Spacing/Spacing.d.ts +0 -17
- package/Spacing/Spacing.js +0 -32
- package/Spacing/index.d.ts +0 -1
- package/Spacing/index.js +0 -1
- package/Sticky/Sticky.d.ts +0 -2
- package/Sticky/Sticky.js +0 -1
- package/Sticky/StickyCss.d.ts +0 -5
- package/Sticky/StickyCss.js +0 -6
- package/Sticky/index.d.ts +0 -1
- package/Sticky/index.js +0 -1
- package/Tabs/TabsMui.d.ts +0 -84
- package/Tabs/TabsMui.js +0 -30
- package/Tabs/index.d.ts +0 -1
- package/Tabs/index.js +0 -1
- package/Tabs/sc/bare.d.ts +0 -0
- package/Tabs/sc/bare.js +0 -1
- package/Tabs/tw/bare.d.ts +0 -85
- package/Tabs/tw/bare.js +0 -17
- package/Tabs/tw/material.d.ts +0 -118
- package/Tabs/tw/material.js +0 -19
- package/Tabs/useTabs.d.ts +0 -21
- package/Tabs/useTabs.js +0 -44
- package/Typography/CopyPasteVisible.d.ts +0 -1
- package/Typography/CopyPasteVisible.js +0 -4
- package/Typography/Native.d.ts +0 -10
- package/Typography/Native.js +0 -14
- package/Typography/ReadMore.d.ts +0 -10
- package/Typography/ReadMore.js +0 -42
- package/Typography/TextLoop.d.ts +0 -16
- package/Typography/TextLoop.js +0 -45
- package/Typography/TypeStairs.d.ts +0 -6
- package/Typography/TypeStairs.js +0 -42
- package/Typography/index.d.ts +0 -5
- package/Typography/index.js +0 -5
- package/classed.js +0 -43
- package/createUseMediaQueryWidth.js +0 -39
- package/css/index.d.ts +0 -1
- package/css/index.js +0 -1
- package/extendComponent.js +0 -9
- package/index.js +0 -24
- package/m/MotionProvider.d.ts +0 -6
- package/m/MotionProvider.js +0 -7
- package/m/index.d.ts +0 -1
- package/m/index.js +0 -1
- package/m/lite.d.ts +0 -2
- package/m/lite.js +0 -2
- package/m/max.d.ts +0 -2
- package/m/max.js +0 -2
- package/mergeRefs.js +0 -13
- package/sc/index.d.ts +0 -29
- package/sc/index.js +0 -29
- package/scm/index.d.ts +0 -28
- package/scm/index.js +0 -28
- package/shared/index.d.ts +0 -7
- package/shared/index.js +0 -7
- package/styles/Body.d.ts +0 -2
- package/styles/Body.js +0 -5
- package/styles/Global.d.ts +0 -2
- package/styles/Global.js +0 -5
- package/styles/index.d.ts +0 -7
- package/styles/index.js +0 -7
- package/styles/media.d.ts +0 -18
- package/styles/media.js +0 -75
- package/styles/spacing.d.ts +0 -12
- package/styles/spacing.js +0 -45
- package/styles/styled.d.ts +0 -8
- package/styles/styled.js +0 -9
- package/styles/theme--vanilla.d.ts +0 -17
- package/styles/theme--vanilla.js +0 -47
- package/styles/theme.d.ts +0 -53
- package/styles/theme.js +0 -30
- package/tw/index.d.ts +0 -1
- package/tw/index.js +0 -1
- package/twm/index.d.ts +0 -1
- package/twm/index.js +0 -1
- package/types.js +0 -1
- package/typings.d.ts +0 -99
- package/useAsyncFn.js +0 -33
- package/useDateLocale.d.ts +0 -2
- package/useDateLocale.js +0 -28
- package/useFirstMountState.js +0 -10
- package/useFixedOffset.js +0 -42
- package/useFocus.js +0 -9
- package/useInterval.js +0 -22
- package/useIsomorphicLayoutEffect.js +0 -6
- package/useKeyUp.js +0 -18
- package/useMeasure.js +0 -130
- package/useMountedState.js +0 -13
- package/useNavigateAway.js +0 -25
- package/usePrevious.js +0 -10
- package/usePreviousRef.js +0 -9
- package/useScrollPosition.js +0 -61
- package/useScrollThreshold.js +0 -27
- package/useScrollTo.js +0 -23
- package/useSmoothScroll.js +0 -32
- package/useSpinDelay.js +0 -39
- package/useTraceUpdate.js +0 -19
- package/useUpdateEffect.js +0 -11
- package/useWindowSize.js +0 -20
package/useAsyncFn.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { __assign, __read, __spreadArray } from "tslib";
|
|
2
|
-
import { useCallback, useRef, useState } from "react";
|
|
3
|
-
import { useMountedState } from "./useMountedState.js";
|
|
4
|
-
export function useAsyncFn(fn, deps, initialState) {
|
|
5
|
-
if (deps === void 0) { deps = []; }
|
|
6
|
-
if (initialState === void 0) { initialState = { loading: false }; }
|
|
7
|
-
var lastCallId = useRef(0);
|
|
8
|
-
var isMounted = useMountedState();
|
|
9
|
-
var _a = __read(useState(initialState), 2), state = _a[0], set = _a[1];
|
|
10
|
-
var callback = useCallback(function () {
|
|
11
|
-
var args = [];
|
|
12
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
13
|
-
args[_i] = arguments[_i];
|
|
14
|
-
}
|
|
15
|
-
var callId = ++lastCallId.current;
|
|
16
|
-
if (!state.loading) {
|
|
17
|
-
set(function (prevState) { return (__assign(__assign({}, prevState), { loading: true })); });
|
|
18
|
-
}
|
|
19
|
-
return fn.apply(void 0, __spreadArray([], __read(args), false)).then(function (value) {
|
|
20
|
-
isMounted() &&
|
|
21
|
-
callId === lastCallId.current &&
|
|
22
|
-
set({ value: value, loading: false });
|
|
23
|
-
return value;
|
|
24
|
-
}, function (error) {
|
|
25
|
-
isMounted() &&
|
|
26
|
-
callId === lastCallId.current &&
|
|
27
|
-
set({ error: error, loading: false });
|
|
28
|
-
return error;
|
|
29
|
-
});
|
|
30
|
-
}, deps);
|
|
31
|
-
return [state, callback];
|
|
32
|
-
}
|
|
33
|
-
export default useAsyncFn;
|
package/useDateLocale.d.ts
DELETED
package/useDateLocale.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { __awaiter, __generator, __read } from "tslib";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
export function useDateLocale(locale, defaultLocale) {
|
|
4
|
-
var _this = this;
|
|
5
|
-
if (defaultLocale === void 0) { defaultLocale = "en"; }
|
|
6
|
-
var _a = __read(useState(), 2), data = _a[0], setData = _a[1];
|
|
7
|
-
var _b = __read(useState(defaultLocale), 2), current = _b[0], setCurrent = _b[1];
|
|
8
|
-
useEffect(function () {
|
|
9
|
-
var importLocaleFile = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
10
|
-
var localeToSet;
|
|
11
|
-
return __generator(this, function (_a) {
|
|
12
|
-
switch (_a.label) {
|
|
13
|
-
case 0: return [4, import("date-fns/locale/en-US/index.js")];
|
|
14
|
-
case 1:
|
|
15
|
-
localeToSet = _a.sent();
|
|
16
|
-
setCurrent(locale || current);
|
|
17
|
-
setData(localeToSet.default);
|
|
18
|
-
return [2];
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}); };
|
|
22
|
-
if (locale !== current) {
|
|
23
|
-
importLocaleFile();
|
|
24
|
-
}
|
|
25
|
-
}, [locale, current]);
|
|
26
|
-
return data;
|
|
27
|
-
}
|
|
28
|
-
export default useDateLocale;
|
package/useFirstMountState.js
DELETED
package/useFixedOffset.js
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
import { debounce } from "@koine/utils";
|
|
3
|
-
import { $each, calculateFixedOffset, injectCss, listenResizeDebounced, } from "@koine/dom";
|
|
4
|
-
import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect.js";
|
|
5
|
-
var inject = function (value) {
|
|
6
|
-
injectCss("useFixedOffset", "html{scroll-padding-top: ".concat(value, "px}"));
|
|
7
|
-
};
|
|
8
|
-
export function useFixedOffset(selector) {
|
|
9
|
-
var fixedOffset = useRef(0);
|
|
10
|
-
useIsomorphicLayoutEffect(function () {
|
|
11
|
-
var update = function () {
|
|
12
|
-
var newFixedOffset = calculateFixedOffset();
|
|
13
|
-
fixedOffset.current = newFixedOffset;
|
|
14
|
-
inject(newFixedOffset);
|
|
15
|
-
};
|
|
16
|
-
update();
|
|
17
|
-
if (ResizeObserver) {
|
|
18
|
-
var observer_1 = new ResizeObserver(function (entries) {
|
|
19
|
-
var newFixedOffset = 0;
|
|
20
|
-
entries.forEach(function (entry) {
|
|
21
|
-
newFixedOffset += entry.contentRect.height;
|
|
22
|
-
});
|
|
23
|
-
fixedOffset.current = newFixedOffset;
|
|
24
|
-
var updateOnResize = debounce(function () { return inject(newFixedOffset); }, 400, true);
|
|
25
|
-
updateOnResize();
|
|
26
|
-
});
|
|
27
|
-
$each(selector || "[data-fixed]", function ($el) {
|
|
28
|
-
if (observer_1)
|
|
29
|
-
observer_1.observe($el);
|
|
30
|
-
});
|
|
31
|
-
return function () {
|
|
32
|
-
observer_1 === null || observer_1 === void 0 ? void 0 : observer_1.disconnect();
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
var listener = listenResizeDebounced(0, update);
|
|
37
|
-
return listener;
|
|
38
|
-
}
|
|
39
|
-
}, [selector]);
|
|
40
|
-
return fixedOffset;
|
|
41
|
-
}
|
|
42
|
-
export default useFixedOffset;
|
package/useFocus.js
DELETED
package/useInterval.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
|
-
import { noop } from "@koine/utils";
|
|
4
|
-
export function useInterval(callback, delay, deps) {
|
|
5
|
-
if (deps === void 0) { deps = []; }
|
|
6
|
-
var savedCallback = useRef();
|
|
7
|
-
useEffect(function () {
|
|
8
|
-
savedCallback.current = callback;
|
|
9
|
-
}, __spreadArray([callback], __read(deps), false));
|
|
10
|
-
useEffect(function () {
|
|
11
|
-
function tick() {
|
|
12
|
-
if (savedCallback.current)
|
|
13
|
-
savedCallback.current();
|
|
14
|
-
}
|
|
15
|
-
if (delay !== null) {
|
|
16
|
-
var id_1 = setInterval(tick, delay);
|
|
17
|
-
return function () { return clearInterval(id_1); };
|
|
18
|
-
}
|
|
19
|
-
return noop;
|
|
20
|
-
}, [delay]);
|
|
21
|
-
}
|
|
22
|
-
export default useInterval;
|
package/useKeyUp.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { useEffect } from "react";
|
|
3
|
-
import { on } from "@koine/dom";
|
|
4
|
-
export function useKeyUp(callback, deps) {
|
|
5
|
-
if (deps === void 0) { deps = []; }
|
|
6
|
-
useEffect(function () {
|
|
7
|
-
var listener = on(window, "keyup", function (event) {
|
|
8
|
-
if (!event.ctrlKey &&
|
|
9
|
-
!event.altKey &&
|
|
10
|
-
!event.shiftKey &&
|
|
11
|
-
!event.metaKey) {
|
|
12
|
-
callback(event);
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
return listener;
|
|
16
|
-
}, __spreadArray([callback], __read(deps), false));
|
|
17
|
-
}
|
|
18
|
-
export default useKeyUp;
|
package/useMeasure.js
DELETED
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
import { __read, __spreadArray } from "tslib";
|
|
2
|
-
import { useEffect, useMemo, useRef, useState } from "react";
|
|
3
|
-
import { debounce, noop } from "@koine/utils";
|
|
4
|
-
import { listenResizeDebounced, listenScrollDebounced, off, on, } from "@koine/dom";
|
|
5
|
-
var observer;
|
|
6
|
-
function findScrollContainers(element) {
|
|
7
|
-
var result = [];
|
|
8
|
-
if (!element || element === document.body)
|
|
9
|
-
return result;
|
|
10
|
-
var _a = window.getComputedStyle(element), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
|
|
11
|
-
if ([overflow, overflowX, overflowY].some(function (prop) { return prop === "auto" || prop === "scroll"; }))
|
|
12
|
-
result.push(element);
|
|
13
|
-
return __spreadArray(__spreadArray([], __read(result), false), __read(findScrollContainers(element.parentElement)), false);
|
|
14
|
-
}
|
|
15
|
-
var keys = [
|
|
16
|
-
"x",
|
|
17
|
-
"y",
|
|
18
|
-
"top",
|
|
19
|
-
"bottom",
|
|
20
|
-
"left",
|
|
21
|
-
"right",
|
|
22
|
-
"width",
|
|
23
|
-
"height",
|
|
24
|
-
];
|
|
25
|
-
var areBoundsEqual = function (a, b) {
|
|
26
|
-
return keys.every(function (key) { return a[key] === b[key]; });
|
|
27
|
-
};
|
|
28
|
-
export function useMeasure(options) {
|
|
29
|
-
var _a = (options || {}).scroll, scroll = _a === void 0 ? false : _a;
|
|
30
|
-
var _b = __read(useState({
|
|
31
|
-
left: 0,
|
|
32
|
-
top: 0,
|
|
33
|
-
width: 0,
|
|
34
|
-
height: 0,
|
|
35
|
-
bottom: 0,
|
|
36
|
-
right: 0,
|
|
37
|
-
x: 0,
|
|
38
|
-
y: 0,
|
|
39
|
-
}), 2), bounds = _b[0], setBounds = _b[1];
|
|
40
|
-
var state = useRef([
|
|
41
|
-
null,
|
|
42
|
-
null,
|
|
43
|
-
null,
|
|
44
|
-
bounds,
|
|
45
|
-
]);
|
|
46
|
-
var mounted = useRef(false);
|
|
47
|
-
useEffect(function () {
|
|
48
|
-
mounted.current = true;
|
|
49
|
-
return function () { return void (mounted.current = false); };
|
|
50
|
-
}, []);
|
|
51
|
-
var _c = __read(useMemo(function () {
|
|
52
|
-
var callback = function () {
|
|
53
|
-
var _args = [];
|
|
54
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
55
|
-
_args[_i] = arguments[_i];
|
|
56
|
-
}
|
|
57
|
-
var _a = __read(state.current, 4), element = _a[0], lastBounds = _a[3];
|
|
58
|
-
if (!element)
|
|
59
|
-
return;
|
|
60
|
-
var size = element.getBoundingClientRect();
|
|
61
|
-
Object.freeze(size);
|
|
62
|
-
if (mounted.current && !areBoundsEqual(lastBounds, size)) {
|
|
63
|
-
state.current[3] = size;
|
|
64
|
-
setBounds(size);
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
var debouncedCallback = debounce(callback);
|
|
68
|
-
return [callback, debouncedCallback, debouncedCallback];
|
|
69
|
-
}, [setBounds]), 3), forceRefresh = _c[0], scrollChange = _c[2];
|
|
70
|
-
function removeListeners() {
|
|
71
|
-
var _a = __read(state.current, 3), scrollContainers = _a[1], resizeObserver = _a[2];
|
|
72
|
-
if (scrollContainers) {
|
|
73
|
-
scrollContainers.forEach(function (element) {
|
|
74
|
-
return off(element, "scroll", scrollChange);
|
|
75
|
-
});
|
|
76
|
-
state.current[1] = null;
|
|
77
|
-
}
|
|
78
|
-
if (resizeObserver) {
|
|
79
|
-
resizeObserver.disconnect();
|
|
80
|
-
state.current[2] = null;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function addListeners() {
|
|
84
|
-
var _a = __read(state.current, 2), element = _a[0], scrollContainers = _a[1];
|
|
85
|
-
if (!element)
|
|
86
|
-
return;
|
|
87
|
-
if (!observer && ResizeObserver) {
|
|
88
|
-
observer = new ResizeObserver(scrollChange);
|
|
89
|
-
state.current[2] = observer;
|
|
90
|
-
observer.observe(element);
|
|
91
|
-
if (scroll && scrollContainers) {
|
|
92
|
-
scrollContainers.forEach(function (scrollContainer) {
|
|
93
|
-
return on(scrollContainer, "scroll", scrollChange, {
|
|
94
|
-
capture: true,
|
|
95
|
-
passive: true,
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
var ref = function (node) {
|
|
102
|
-
if (!node || node === state.current[0])
|
|
103
|
-
return;
|
|
104
|
-
removeListeners();
|
|
105
|
-
state.current[0] = node;
|
|
106
|
-
state.current[1] = findScrollContainers(node);
|
|
107
|
-
addListeners();
|
|
108
|
-
};
|
|
109
|
-
useEffect(function () {
|
|
110
|
-
if (scroll) {
|
|
111
|
-
var listener = listenScrollDebounced(0, forceRefresh, 100);
|
|
112
|
-
return listener;
|
|
113
|
-
}
|
|
114
|
-
return noop;
|
|
115
|
-
}, [scroll, forceRefresh]);
|
|
116
|
-
useEffect(function () {
|
|
117
|
-
var listener = listenResizeDebounced(0, forceRefresh, 100);
|
|
118
|
-
return listener;
|
|
119
|
-
}, [forceRefresh]);
|
|
120
|
-
useEffect(function () {
|
|
121
|
-
removeListeners();
|
|
122
|
-
addListeners();
|
|
123
|
-
}, [scroll]);
|
|
124
|
-
useEffect(function () {
|
|
125
|
-
forceRefresh();
|
|
126
|
-
return removeListeners;
|
|
127
|
-
}, []);
|
|
128
|
-
return [ref, bounds, forceRefresh];
|
|
129
|
-
}
|
|
130
|
-
export default useMeasure;
|
package/useMountedState.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
-
export function useMountedState() {
|
|
3
|
-
var mountedRef = useRef(false);
|
|
4
|
-
var get = useCallback(function () { return mountedRef.current; }, []);
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
mountedRef.current = true;
|
|
7
|
-
return function () {
|
|
8
|
-
mountedRef.current = false;
|
|
9
|
-
};
|
|
10
|
-
}, []);
|
|
11
|
-
return get;
|
|
12
|
-
}
|
|
13
|
-
export default useMountedState;
|
package/useNavigateAway.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { useEffect, useRef } from "react";
|
|
2
|
-
import { on } from "@koine/dom";
|
|
3
|
-
export var useNavigateAway = function (handler) {
|
|
4
|
-
var beforeUnloadHandlerRef = useRef();
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
beforeUnloadHandlerRef.current = function (event) {
|
|
7
|
-
var customMessageOrCondition = handler(event);
|
|
8
|
-
if (customMessageOrCondition) {
|
|
9
|
-
event.preventDefault();
|
|
10
|
-
}
|
|
11
|
-
if (typeof customMessageOrCondition === "string") {
|
|
12
|
-
return (event.returnValue = customMessageOrCondition);
|
|
13
|
-
}
|
|
14
|
-
if (event.defaultPrevented) {
|
|
15
|
-
return (event.returnValue = "");
|
|
16
|
-
}
|
|
17
|
-
return;
|
|
18
|
-
};
|
|
19
|
-
}, [handler]);
|
|
20
|
-
useEffect(function () {
|
|
21
|
-
var listenerBeforeunload = on(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
|
|
22
|
-
return listenerBeforeunload;
|
|
23
|
-
}, []);
|
|
24
|
-
};
|
|
25
|
-
export default useNavigateAway;
|
package/usePrevious.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { useState } from "react";
|
|
3
|
-
export function usePrevious(state, defaulValue) {
|
|
4
|
-
var _a = __read(useState([state, defaulValue]), 2), tuple = _a[0], setTuple = _a[1];
|
|
5
|
-
if (tuple[1] !== state) {
|
|
6
|
-
setTuple([tuple[1], state]);
|
|
7
|
-
}
|
|
8
|
-
return tuple[0];
|
|
9
|
-
}
|
|
10
|
-
export default usePrevious;
|
package/usePreviousRef.js
DELETED
package/useScrollPosition.js
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { useRef } from "react";
|
|
2
|
-
import { isBrowser } from "@koine/utils";
|
|
3
|
-
import { listenScroll } from "@koine/dom";
|
|
4
|
-
import useIsomorphicLayoutEffect from "./useIsomorphicLayoutEffect.js";
|
|
5
|
-
var zeroPosition = { x: 0, y: 0 };
|
|
6
|
-
var getClientRect = function (element) {
|
|
7
|
-
return element === null || element === void 0 ? void 0 : element.getBoundingClientRect();
|
|
8
|
-
};
|
|
9
|
-
var getScrollPosition = function (element, boundingElement) {
|
|
10
|
-
if (!isBrowser) {
|
|
11
|
-
return zeroPosition;
|
|
12
|
-
}
|
|
13
|
-
if (!boundingElement) {
|
|
14
|
-
return { x: window.scrollX, y: window.scrollY };
|
|
15
|
-
}
|
|
16
|
-
var targetPosition = getClientRect((element === null || element === void 0 ? void 0 : element.current) || document.body);
|
|
17
|
-
var containerPosition = getClientRect(boundingElement.current);
|
|
18
|
-
if (!targetPosition) {
|
|
19
|
-
return zeroPosition;
|
|
20
|
-
}
|
|
21
|
-
return containerPosition
|
|
22
|
-
? {
|
|
23
|
-
x: (containerPosition.x || 0) - (targetPosition.x || 0),
|
|
24
|
-
y: (containerPosition.y || 0) - (targetPosition.y || 0),
|
|
25
|
-
}
|
|
26
|
-
: { x: targetPosition.left, y: targetPosition.top };
|
|
27
|
-
};
|
|
28
|
-
export var useScrollPosition = function (effect, deps, element, boundingElement, wait) {
|
|
29
|
-
if (deps === void 0) { deps = []; }
|
|
30
|
-
var position = useRef(getScrollPosition(null, boundingElement));
|
|
31
|
-
var throttleTimeout = null;
|
|
32
|
-
var callBack = function () {
|
|
33
|
-
var current = getScrollPosition(element, boundingElement);
|
|
34
|
-
effect(current, position.current);
|
|
35
|
-
position.current = current;
|
|
36
|
-
throttleTimeout = null;
|
|
37
|
-
};
|
|
38
|
-
useIsomorphicLayoutEffect(function () {
|
|
39
|
-
if (!isBrowser) {
|
|
40
|
-
return undefined;
|
|
41
|
-
}
|
|
42
|
-
var handleScroll = function () {
|
|
43
|
-
if (wait) {
|
|
44
|
-
if (throttleTimeout === null) {
|
|
45
|
-
throttleTimeout = window.setTimeout(callBack, wait);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
callBack();
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
|
-
var listener = listenScroll(handleScroll, boundingElement === null || boundingElement === void 0 ? void 0 : boundingElement.current);
|
|
53
|
-
return function () {
|
|
54
|
-
listener();
|
|
55
|
-
if (throttleTimeout) {
|
|
56
|
-
clearTimeout(throttleTimeout);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
}, deps);
|
|
60
|
-
};
|
|
61
|
-
export default useScrollPosition;
|
package/useScrollThreshold.js
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { useCallback, useEffect, useState } from "react";
|
|
3
|
-
import { noop } from "@koine/utils";
|
|
4
|
-
import { listenScroll } from "@koine/dom";
|
|
5
|
-
export var useScrollThreshold = function (threshold, callback) {
|
|
6
|
-
var _a = __read(useState(false), 2), isBelow = _a[0], setIsBelow = _a[1];
|
|
7
|
-
var handler = useCallback(function () {
|
|
8
|
-
if (threshold) {
|
|
9
|
-
var posY = window.scrollY;
|
|
10
|
-
var isAbove = posY < threshold;
|
|
11
|
-
var isBelow_1 = posY > threshold;
|
|
12
|
-
setIsBelow(isBelow_1);
|
|
13
|
-
if (callback)
|
|
14
|
-
callback(isAbove, isBelow_1);
|
|
15
|
-
}
|
|
16
|
-
}, [threshold, callback]);
|
|
17
|
-
useEffect(function () {
|
|
18
|
-
if (threshold) {
|
|
19
|
-
var listener = listenScroll(handler);
|
|
20
|
-
handler();
|
|
21
|
-
return listener;
|
|
22
|
-
}
|
|
23
|
-
return noop;
|
|
24
|
-
}, [threshold, handler]);
|
|
25
|
-
return isBelow;
|
|
26
|
-
};
|
|
27
|
-
export default useScrollThreshold;
|
package/useScrollTo.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { isBrowser } from "@koine/utils";
|
|
3
|
-
import useHeader from "./Header/useHeader.js";
|
|
4
|
-
export function useScrollTo(id, offset) {
|
|
5
|
-
if (id === void 0) { id = ""; }
|
|
6
|
-
if (offset === void 0) { offset = 0; }
|
|
7
|
-
var _a = __read(useHeader(), 3), headerHeight = _a[2];
|
|
8
|
-
if (!isBrowser) {
|
|
9
|
-
return;
|
|
10
|
-
}
|
|
11
|
-
var headerOffset = headerHeight || 0;
|
|
12
|
-
var element = document.getElementById(id);
|
|
13
|
-
var top = 0;
|
|
14
|
-
if (element && element.offsetParent) {
|
|
15
|
-
do {
|
|
16
|
-
top += element.offsetTop;
|
|
17
|
-
} while ((element = element.offsetParent));
|
|
18
|
-
}
|
|
19
|
-
top -= offset;
|
|
20
|
-
top -= headerOffset;
|
|
21
|
-
window.scroll(0, top);
|
|
22
|
-
}
|
|
23
|
-
export default useScrollTo;
|
package/useSmoothScroll.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { useCallback } from "react";
|
|
2
|
-
import { isNumber } from "@koine/utils";
|
|
3
|
-
import { getOffsetTopSlim, scrollTo } from "@koine/dom";
|
|
4
|
-
import useFixedOffset from "./useFixedOffset.js";
|
|
5
|
-
export function useSmoothScroll(disregardAutomaticFixedOffset) {
|
|
6
|
-
var fixedOffset = useFixedOffset();
|
|
7
|
-
var scroll = useCallback(function (to, customOffset, callback, fallbackTimeout, behavior) {
|
|
8
|
-
var top = undefined;
|
|
9
|
-
var toIsElement = false;
|
|
10
|
-
if (isNumber(to)) {
|
|
11
|
-
top = to;
|
|
12
|
-
}
|
|
13
|
-
else if (to) {
|
|
14
|
-
var el = document.getElementById(to);
|
|
15
|
-
if (el) {
|
|
16
|
-
top = getOffsetTopSlim(el) - fixedOffset.current;
|
|
17
|
-
toIsElement = true;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
if (isNumber(top)) {
|
|
21
|
-
top =
|
|
22
|
-
top +
|
|
23
|
-
(customOffset || 0) +
|
|
24
|
-
(disregardAutomaticFixedOffset || toIsElement
|
|
25
|
-
? 0
|
|
26
|
-
: fixedOffset.current);
|
|
27
|
-
scrollTo(top, callback, fallbackTimeout, behavior);
|
|
28
|
-
}
|
|
29
|
-
}, [disregardAutomaticFixedOffset, fixedOffset]);
|
|
30
|
-
return scroll;
|
|
31
|
-
}
|
|
32
|
-
export default useSmoothScroll;
|
package/useSpinDelay.js
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { useEffect, useRef, useState } from "react";
|
|
3
|
-
var State;
|
|
4
|
-
(function (State) {
|
|
5
|
-
State[State["IDLE"] = 0] = "IDLE";
|
|
6
|
-
State[State["DELAY"] = 1] = "DELAY";
|
|
7
|
-
State[State["DISPLAY"] = 2] = "DISPLAY";
|
|
8
|
-
State[State["EXPIRE"] = 3] = "EXPIRE";
|
|
9
|
-
})(State || (State = {}));
|
|
10
|
-
export function useSpinDelay(loading, delay, minDuration) {
|
|
11
|
-
if (delay === void 0) { delay = 500; }
|
|
12
|
-
if (minDuration === void 0) { minDuration = 200; }
|
|
13
|
-
var _a = __read(useState(State.IDLE), 2), state = _a[0], setState = _a[1];
|
|
14
|
-
var timeout = useRef();
|
|
15
|
-
useEffect(function () {
|
|
16
|
-
if (loading && state === State.IDLE) {
|
|
17
|
-
clearTimeout(timeout.current);
|
|
18
|
-
timeout.current = setTimeout(function () {
|
|
19
|
-
if (!loading) {
|
|
20
|
-
return setState(State.IDLE);
|
|
21
|
-
}
|
|
22
|
-
timeout.current = setTimeout(function () {
|
|
23
|
-
setState(State.EXPIRE);
|
|
24
|
-
}, minDuration);
|
|
25
|
-
setState(State.DISPLAY);
|
|
26
|
-
}, delay);
|
|
27
|
-
setState(State.DELAY);
|
|
28
|
-
}
|
|
29
|
-
if (!loading && state !== State.DISPLAY) {
|
|
30
|
-
clearTimeout(timeout.current);
|
|
31
|
-
setState(State.IDLE);
|
|
32
|
-
}
|
|
33
|
-
}, [loading, state, delay, minDuration]);
|
|
34
|
-
useEffect(function () {
|
|
35
|
-
return function () { return clearTimeout(timeout.current); };
|
|
36
|
-
}, []);
|
|
37
|
-
return state === State.DISPLAY || state === State.EXPIRE;
|
|
38
|
-
}
|
|
39
|
-
export default useSpinDelay;
|
package/useTraceUpdate.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { useEffect, useRef } from "react";
|
|
3
|
-
export function useTraceUpdate(props) {
|
|
4
|
-
var prev = useRef(props);
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
var changedProps = Object.entries(props).reduce(function (ps, _a) {
|
|
7
|
-
var _b = __read(_a, 2), k = _b[0], v = _b[1];
|
|
8
|
-
if (prev.current[k] !== v) {
|
|
9
|
-
ps[k] = [prev.current[k], v];
|
|
10
|
-
}
|
|
11
|
-
return ps;
|
|
12
|
-
}, {});
|
|
13
|
-
if (Object.keys(changedProps).length > 0) {
|
|
14
|
-
console.info("[@koine/react:useTraceUpdate] changed props:", changedProps);
|
|
15
|
-
}
|
|
16
|
-
prev.current = props;
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
export default useTraceUpdate;
|
package/useUpdateEffect.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { useEffect } from "react";
|
|
2
|
-
import { useFirstMountState } from "./useFirstMountState.js";
|
|
3
|
-
export var useUpdateEffect = function (effect, deps) {
|
|
4
|
-
var isFirstMount = useFirstMountState();
|
|
5
|
-
useEffect(function () {
|
|
6
|
-
if (!isFirstMount) {
|
|
7
|
-
return effect();
|
|
8
|
-
}
|
|
9
|
-
}, deps);
|
|
10
|
-
};
|
|
11
|
-
export default useUpdateEffect;
|
package/useWindowSize.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { __read } from "tslib";
|
|
2
|
-
import { useEffect, useState } from "react";
|
|
3
|
-
import { listenResize, listenResizeDebounced } from "@koine/dom";
|
|
4
|
-
export function useWindowSize(wait, immediate) {
|
|
5
|
-
var _a = __read(useState(0), 2), width = _a[0], widthSet = _a[1];
|
|
6
|
-
var _b = __read(useState(0), 2), height = _b[0], heightSet = _b[1];
|
|
7
|
-
useEffect(function () {
|
|
8
|
-
function updateSize() {
|
|
9
|
-
widthSet(window.innerWidth);
|
|
10
|
-
heightSet(window.innerHeight);
|
|
11
|
-
}
|
|
12
|
-
var listener = wait
|
|
13
|
-
? listenResizeDebounced(0, updateSize, wait, immediate)
|
|
14
|
-
: listenResize(updateSize);
|
|
15
|
-
updateSize();
|
|
16
|
-
return listener;
|
|
17
|
-
}, [wait, immediate]);
|
|
18
|
-
return [width, height];
|
|
19
|
-
}
|
|
20
|
-
export default useWindowSize;
|