@koine/react 1.1.9 → 1.1.11
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/Alert/Alert.js +12 -8
- package/Alert/Alert.mjs +10 -0
- package/Alert/index.js +4 -1
- package/Alert/index.mjs +1 -0
- package/Alert/package.json +2 -2
- package/Animations/Reveal.js +18 -14
- package/Animations/Reveal.mjs +17 -0
- package/Animations/Underline.js +7 -4
- package/Animations/Underline.mjs +5 -0
- package/Animations/index.js +6 -3
- package/Animations/index.mjs +3 -0
- package/Animations/package.json +2 -2
- package/Animations/useReveal.js +11 -7
- package/{node/Animations/useReveal.js → Animations/useReveal.mjs} +7 -11
- package/Autocomplete/AutocompleteDownshift.js +5 -2
- package/{node/Autocomplete/AutocompleteDownshift.js → Autocomplete/AutocompleteDownshift.mjs} +2 -5
- package/Autocomplete/AutocompleteDownshiftMultiselect.js +5 -2
- package/{node/Autocomplete/AutocompleteDownshiftMultiselect.js → Autocomplete/AutocompleteDownshiftMultiselect.mjs} +2 -5
- package/Autocomplete/AutocompleteMui.js +33 -35
- package/{node/Autocomplete/AutocompleteMui.js → Autocomplete/AutocompleteMui.mjs} +35 -33
- package/Autocomplete/AutocompleteReach.js +5 -2
- package/{node/Autocomplete/AutocompleteReach.js → Autocomplete/AutocompleteReach.mjs} +2 -5
- package/Autocomplete/components.js +25 -22
- package/Autocomplete/components.mjs +34 -0
- package/Autocomplete/helpers.js +11 -5
- package/{node/Autocomplete/helpers.js → Autocomplete/helpers.mjs} +6 -9
- package/Autocomplete/index.js +5 -1
- package/Autocomplete/index.mjs +3 -0
- package/Autocomplete/package.json +2 -2
- package/Bg/BgColor.js +14 -10
- package/Bg/BgColor.mjs +21 -0
- package/Bg/BgPhoto.js +13 -9
- package/Bg/BgPhoto.mjs +16 -0
- package/Bg/BgSvg.js +10 -6
- package/Bg/BgSvg.mjs +12 -0
- package/Bg/index.js +6 -3
- package/Bg/index.mjs +3 -0
- package/Bg/package.json +2 -2
- package/Breadcrumbs/Breadcrumbs.js +22 -18
- package/Breadcrumbs/Breadcrumbs.mjs +27 -0
- package/Breadcrumbs/index.js +4 -1
- package/Breadcrumbs/index.mjs +1 -0
- package/Breadcrumbs/package.json +2 -2
- package/Buttons/Button.js +12 -9
- package/Buttons/Button.mjs +14 -0
- package/Buttons/ButtonComposite.js +20 -16
- package/Buttons/ButtonComposite.mjs +28 -0
- package/Buttons/ButtonFab.js +8 -5
- package/Buttons/ButtonFab.mjs +6 -0
- package/Buttons/ButtonLink.js +12 -8
- package/Buttons/ButtonLink.mjs +11 -0
- package/Buttons/IconButton.js +9 -6
- package/Buttons/IconButton.mjs +7 -0
- package/Buttons/index.js +8 -5
- package/Buttons/index.mjs +5 -0
- package/Buttons/package.json +2 -2
- package/Calendar/CalendarDaygridCell.js +16 -12
- package/{node/Calendar/CalendarDaygridCell.js → Calendar/CalendarDaygridCell.mjs} +12 -16
- package/Calendar/CalendarDaygridNav.js +14 -9
- package/Calendar/CalendarDaygridNav.mjs +23 -0
- package/Calendar/CalendarDaygridTable.js +23 -19
- package/{node/Calendar/CalendarDaygridTable.js → Calendar/CalendarDaygridTable.mjs} +19 -23
- package/Calendar/CalendarLegend.js +9 -5
- package/Calendar/CalendarLegend.mjs +16 -0
- package/Calendar/calendar-api-google.js +27 -21
- package/{node/Calendar/calendar-api-google.js → Calendar/calendar-api-google.mjs} +23 -25
- package/Calendar/index.js +9 -6
- package/Calendar/index.mjs +6 -0
- package/Calendar/package.json +2 -2
- package/Calendar/types.js +2 -1
- package/Calendar/types.mjs +1 -0
- package/Calendar/useCalendar.js +43 -39
- package/{node/Calendar/useCalendar.js → Calendar/useCalendar.mjs} +39 -43
- package/Calendar/utils.js +44 -31
- package/{node/Calendar/utils.js → Calendar/utils.mjs} +31 -44
- package/Carousel/Carousel.js +4 -1
- package/{node/Carousel/Carousel.js → Carousel/Carousel.mjs} +1 -4
- package/Carousel/CarouselCss.js +17 -13
- package/Carousel/CarouselCss.mjs +22 -0
- package/Carousel/index.js +4 -1
- package/Carousel/index.mjs +1 -0
- package/Carousel/package.json +2 -2
- package/Collapsable/Collapsable.js +4 -1
- package/Collapsable/Collapsable.mjs +1 -0
- package/{node/Collapsable/CollapsableReach.js → Collapsable/CollapsableReach.mjs} +0 -0
- package/Collapsable/index.js +4 -1
- package/Collapsable/index.mjs +2 -0
- package/Collapsable/package.json +2 -2
- package/Debug/Debug.js +10 -6
- package/Debug/Debug.mjs +9 -0
- package/Debug/index.js +4 -1
- package/Debug/index.mjs +1 -0
- package/Debug/package.json +2 -2
- package/Details/Details.d.ts +1 -1
- package/Details/Details.js +30 -27
- package/Details/Details.mjs +63 -0
- package/Details/index.js +4 -1
- package/Details/index.mjs +1 -0
- package/Details/package.json +2 -2
- package/Dialog/DialogMui.d.ts +2 -2
- package/Dialog/DialogMui.js +28 -25
- package/{node/Dialog/DialogMui.js → Dialog/DialogMui.mjs} +25 -28
- package/Dialog/css/bare.js +21 -18
- package/Dialog/css/bare.mjs +21 -0
- package/Dialog/index.js +5 -1
- package/Dialog/index.mjs +1 -0
- package/Dialog/m/bare.js +26 -23
- package/Dialog/m/bare.mjs +52 -0
- package/Dialog/m/basic.js +7 -3
- package/{node/Dialog/m/basic.js → Dialog/m/basic.mjs} +3 -7
- package/Dialog/m/index.js +7 -3
- package/Dialog/m/index.mjs +4 -0
- package/Dialog/m/package.json +2 -2
- package/Dialog/package.json +2 -2
- package/Dialog/sc/bare.js +24 -21
- package/Dialog/sc/bare.mjs +43 -0
- package/Dialog/sc/framer.js +18 -15
- package/Dialog/sc/framer.mjs +16 -0
- package/Dialog/sc/framerMaterial.js +18 -15
- package/Dialog/sc/framerMaterial.mjs +16 -0
- package/Dialog/sc/material.js +22 -19
- package/Dialog/sc/material.mjs +21 -0
- package/Dialog/tw/bare.d.ts +6 -6
- package/Dialog/tw/bare.js +21 -18
- package/Dialog/tw/bare.mjs +42 -0
- package/Dialog/tw/elegant.d.ts +6 -6
- package/Dialog/tw/elegant.js +21 -18
- package/Dialog/tw/elegant.mjs +20 -0
- package/Dialog/tw/framer.d.ts +2 -2
- package/Dialog/tw/framer.js +18 -15
- package/Dialog/tw/framer.mjs +16 -0
- package/Dialog/tw/framerMaterial.d.ts +4 -4
- package/Dialog/tw/framerMaterial.js +18 -15
- package/Dialog/tw/framerMaterial.mjs +16 -0
- package/Dialog/tw/material.d.ts +6 -6
- package/Dialog/tw/material.js +21 -18
- package/Dialog/tw/material.mjs +20 -0
- package/Editor/Editor--tiptap.js +20 -15
- package/Editor/Editor--tiptap.mjs +26 -0
- package/Editor/components.js +14 -9
- package/Editor/components.mjs +10 -0
- package/Editor/index.js +4 -1
- package/Editor/index.mjs +1 -0
- package/Editor/package.json +2 -2
- package/FaviconTags/FaviconTags.js +8 -4
- package/FaviconTags/FaviconTags.mjs +16 -0
- package/FaviconTags/index.js +7 -2
- package/FaviconTags/index.mjs +2 -0
- package/FaviconTags/package.json +2 -2
- package/Form/Form.d.ts +1 -1
- package/Form/Form.js +28 -24
- package/Form/Form.mjs +61 -0
- package/Form/index.js +4 -1
- package/Form/index.mjs +1 -0
- package/Form/package.json +2 -2
- package/Form/sc/bare.js +21 -18
- package/Form/sc/bare.mjs +20 -0
- package/Forms/Checkbox/Checkbox.d.ts +1 -1
- package/Forms/Checkbox/Checkbox.js +16 -13
- package/Forms/Checkbox/Checkbox.mjs +18 -0
- package/Forms/Checkbox/index.js +4 -1
- package/Forms/Checkbox/index.mjs +1 -0
- package/Forms/Checkbox/package.json +2 -2
- package/Forms/Feedback/Feedback.js +10 -6
- package/Forms/Feedback/Feedback.mjs +9 -0
- package/Forms/Feedback/index.js +4 -1
- package/Forms/Feedback/index.mjs +1 -0
- package/Forms/Feedback/package.json +2 -2
- package/Forms/Field/Field.js +14 -10
- package/Forms/Field/Field.mjs +31 -0
- package/Forms/Field/FieldControl.js +18 -14
- package/Forms/Field/FieldControl.mjs +47 -0
- package/Forms/Field/FieldHint.js +6 -3
- package/Forms/Field/FieldHint.mjs +4 -0
- package/Forms/Field/index.js +5 -2
- package/Forms/Field/index.mjs +2 -0
- package/Forms/Field/package.json +2 -2
- package/Forms/Input/Input.d.ts +1 -1
- package/Forms/Input/Input.js +17 -14
- package/Forms/Input/Input.mjs +17 -0
- package/Forms/Input/index.js +4 -1
- package/Forms/Input/index.mjs +1 -0
- package/Forms/Input/package.json +2 -2
- package/Forms/InputGroup/InputGroup.js +17 -13
- package/Forms/InputGroup/InputGroup.mjs +15 -0
- package/Forms/InputGroup/index.js +4 -1
- package/Forms/InputGroup/index.mjs +1 -0
- package/Forms/InputGroup/package.json +2 -2
- package/Forms/Label/Label.js +8 -5
- package/Forms/Label/Label.mjs +6 -0
- package/Forms/Label/index.js +4 -1
- package/Forms/Label/index.mjs +1 -0
- package/Forms/Label/package.json +2 -2
- package/Forms/Password/Password.d.ts +1 -1
- package/Forms/Password/Password.js +17 -14
- package/Forms/Password/Password.mjs +17 -0
- package/Forms/Password/index.js +4 -1
- package/Forms/Password/index.mjs +1 -0
- package/Forms/Password/package.json +2 -2
- package/Forms/Radio/Radio.d.ts +1 -1
- package/Forms/Radio/Radio.js +22 -19
- package/Forms/Radio/Radio.mjs +25 -0
- package/Forms/Radio/index.js +4 -1
- package/Forms/Radio/index.mjs +1 -0
- package/Forms/Radio/package.json +2 -2
- package/Forms/Switch/Switch.d.ts +1 -1
- package/Forms/Switch/Switch.js +16 -13
- package/Forms/Switch/Switch.mjs +20 -0
- package/Forms/Switch/index.js +4 -1
- package/Forms/Switch/index.mjs +1 -0
- package/Forms/Switch/package.json +2 -2
- package/Forms/Textarea/Textarea.js +13 -10
- package/Forms/Textarea/Textarea.mjs +12 -0
- package/Forms/Textarea/TextareaRich.js +15 -12
- package/Forms/Textarea/TextareaRich.mjs +28 -0
- package/Forms/Textarea/index.js +5 -2
- package/Forms/Textarea/index.mjs +2 -0
- package/Forms/Textarea/package.json +2 -2
- package/{node/Forms/Toggle/Toggle-tailwind.js → Forms/Toggle/Toggle-tailwind.mjs} +0 -0
- package/Forms/Toggle/Toggle.js +26 -21
- package/Forms/Toggle/Toggle.mjs +31 -0
- package/Forms/Toggle/index.js +4 -1
- package/Forms/Toggle/index.mjs +1 -0
- package/Forms/Toggle/package.json +2 -2
- package/{node/Forms/Toggle/useToggle-tailwind.js → Forms/Toggle/useToggle-tailwind.mjs} +0 -0
- package/Forms/Toggle/useToggle.js +19 -15
- package/{node/Forms/Toggle/useToggle.js → Forms/Toggle/useToggle.mjs} +15 -19
- package/Forms/antispam.d.ts +1 -1
- package/Forms/antispam.js +16 -8
- package/{node/Forms/antispam.js → Forms/antispam.mjs} +10 -13
- package/Forms/helpers.js +16 -7
- package/{node/Forms/helpers.js → Forms/helpers.mjs} +8 -14
- package/Forms/index.js +18 -15
- package/Forms/index.mjs +16 -0
- package/Forms/package.json +2 -2
- package/Forms/styles.js +19 -16
- package/Forms/styles.mjs +29 -0
- package/Gauge/Gauge.js +5 -1
- package/{node/Gauge/Gauge.js → Gauge/Gauge.mjs} +1 -5
- package/Grid/Grid.js +13 -10
- package/Grid/Grid.mjs +53 -0
- package/Grid/index.js +4 -1
- package/Grid/index.mjs +1 -0
- package/Grid/package.json +2 -2
- package/Hamburger/Hamburger.js +11 -7
- package/Hamburger/Hamburger.mjs +52 -0
- package/Hamburger/index.js +4 -1
- package/Hamburger/index.mjs +1 -0
- package/Hamburger/package.json +2 -2
- package/Header/index.js +4 -1
- package/Header/index.mjs +1 -0
- package/Header/package.json +2 -2
- package/Header/useHeader.d.ts +1 -1
- package/Header/useHeader.js +18 -13
- package/Header/useHeader.mjs +31 -0
- package/Hidden/Hidden.js +6 -3
- package/Hidden/Hidden.mjs +10 -0
- package/Hidden/index.js +4 -1
- package/Hidden/index.mjs +1 -0
- package/Hidden/package.json +2 -2
- package/Img/index.js +4 -1
- package/Img/index.mjs +1 -0
- package/Img/package.json +2 -2
- package/Img/sc/bare.js +6 -3
- package/{node/Img/sc/bare.js → Img/sc/bare.mjs} +3 -6
- package/Img/types.js +2 -1
- package/Img/types.mjs +1 -0
- package/Link/Link.js +6 -3
- package/Link/Link.mjs +4 -0
- package/Link/LinkBlank.js +15 -11
- package/Link/LinkBlank.mjs +17 -0
- package/Link/index.js +5 -2
- package/Link/index.mjs +2 -0
- package/Link/package.json +2 -2
- package/Menu/Menu.js +6 -3
- package/Menu/Menu.mjs +4 -0
- package/Menu/MenuMui.js +29 -26
- package/Menu/MenuMui.mjs +75 -0
- package/Menu/index.js +4 -1
- package/Menu/index.mjs +1 -0
- package/Menu/package.json +2 -2
- package/MenuItem/MenuItem.js +6 -3
- package/MenuItem/MenuItem.mjs +4 -0
- package/MenuItem/MenuItemMui.js +13 -10
- package/MenuItem/MenuItemMui.mjs +15 -0
- package/MenuItem/index.js +4 -1
- package/MenuItem/index.mjs +1 -0
- package/MenuItem/package.json +2 -2
- package/MenuItem/useMenuItem.js +20 -16
- package/{node/MenuItem/useMenuItem.js → MenuItem/useMenuItem.mjs} +16 -20
- package/Meta/Meta.js +8 -4
- package/Meta/Meta.mjs +6 -0
- package/Meta/index.js +7 -2
- package/Meta/index.mjs +2 -0
- package/Meta/package.json +2 -2
- package/NoJs/NoJs.js +8 -4
- package/NoJs/NoJs.mjs +7 -0
- package/NoJs/index.js +7 -2
- package/NoJs/index.mjs +2 -0
- package/NoJs/package.json +2 -2
- package/Pagination/PaginationNav.js +22 -18
- package/Pagination/PaginationNav.mjs +61 -0
- package/Pagination/PaginationResults.js +12 -8
- package/Pagination/PaginationResults.mjs +11 -0
- package/Pagination/index.js +5 -2
- package/Pagination/index.mjs +2 -0
- package/Pagination/package.json +2 -2
- package/Pill/Pill.js +9 -6
- package/Pill/Pill.mjs +7 -0
- package/Pill/index.js +4 -1
- package/Pill/index.mjs +1 -0
- package/Pill/package.json +2 -2
- package/Progress/ProgressCircular.js +14 -10
- package/Progress/ProgressCircular.mjs +15 -0
- package/Progress/ProgressLinear.js +13 -9
- package/Progress/ProgressLinear.mjs +24 -0
- package/Progress/ProgressOverlay.js +20 -16
- package/Progress/ProgressOverlay.mjs +24 -0
- package/Progress/index.js +6 -3
- package/Progress/index.mjs +3 -0
- package/Progress/package.json +2 -2
- package/Rating/Rating.js +26 -21
- package/Rating/Rating.mjs +70 -0
- package/Rating/index.js +13 -5
- package/{node/Rating/index.js → Rating/index.mjs} +5 -13
- package/Rating/package.json +2 -2
- package/Select/SelectDownshift.js +4 -1
- package/{node/Select/SelectDownshift.js → Select/SelectDownshift.mjs} +1 -4
- package/Select/components.js +13 -10
- package/Select/components.mjs +12 -0
- package/Select/index.js +5 -1
- package/Select/index.mjs +3 -0
- package/Select/package.json +2 -2
- package/Sidebar/Sidebar.js +21 -17
- package/Sidebar/Sidebar.mjs +23 -0
- package/Sidebar/index.js +4 -1
- package/Sidebar/index.mjs +1 -0
- package/Sidebar/package.json +2 -2
- package/Spacing/Spacing.js +15 -11
- package/Spacing/Spacing.mjs +45 -0
- package/Spacing/index.js +4 -1
- package/Spacing/index.mjs +1 -0
- package/Spacing/package.json +2 -2
- package/Sticky/Sticky.js +4 -1
- package/{node/Sticky/Sticky.js → Sticky/Sticky.mjs} +1 -4
- package/Sticky/StickyCss.js +9 -5
- package/Sticky/StickyCss.mjs +6 -0
- package/Sticky/index.js +4 -1
- package/Sticky/index.mjs +1 -0
- package/Sticky/package.json +2 -2
- package/Tabs/TabsMui.d.ts +2 -2
- package/Tabs/TabsMui.js +28 -25
- package/Tabs/TabsMui.mjs +46 -0
- package/Tabs/index.js +4 -1
- package/Tabs/index.mjs +1 -0
- package/Tabs/package.json +2 -2
- package/{node/Tabs/sc/bare.js → Tabs/sc/bare.mjs} +0 -0
- package/Tabs/tw/bare.js +17 -14
- package/Tabs/tw/bare.mjs +17 -0
- package/Tabs/tw/material.d.ts +6 -6
- package/Tabs/tw/material.js +17 -14
- package/Tabs/tw/material.mjs +18 -0
- package/Tabs/useTabs.js +12 -8
- package/{node/Tabs/useTabs.js → Tabs/useTabs.mjs} +8 -12
- package/Typography/CopyPasteVisible.js +6 -3
- package/Typography/CopyPasteVisible.mjs +4 -0
- package/Typography/Native.js +16 -13
- package/Typography/Native.mjs +14 -0
- package/Typography/ReadMore.js +28 -24
- package/Typography/ReadMore.mjs +43 -0
- package/Typography/TextLoop.js +21 -16
- package/{node/Typography/TextLoop.js → Typography/TextLoop.mjs} +16 -21
- package/Typography/TypeStairs.js +11 -8
- package/{node/Typography/TypeStairs.js → Typography/TypeStairs.mjs} +8 -11
- package/Typography/index.js +8 -5
- package/Typography/index.mjs +5 -0
- package/Typography/package.json +2 -2
- package/css/index.js +7 -2
- package/{node/tw/index.js → css/index.mjs} +2 -7
- package/css/package.json +2 -2
- package/helpers/classed.js +10 -6
- package/{node/helpers/classed.js → helpers/classed.mjs} +6 -10
- package/helpers/createUseMediaQueryWidth.d.ts +1 -1
- package/helpers/createUseMediaQueryWidth.js +18 -11
- package/{node/helpers/createUseMediaQueryWidth.js → helpers/createUseMediaQueryWidth.mjs} +13 -15
- package/helpers/extend-component.js +10 -6
- package/helpers/extend-component.mjs +13 -0
- package/helpers/index.js +7 -4
- package/helpers/index.mjs +4 -0
- package/helpers/mergeRefs.js +6 -2
- package/{node/helpers/mergeRefs.js → helpers/mergeRefs.mjs} +2 -6
- package/helpers/package.json +2 -2
- package/hooks/index.js +24 -21
- package/hooks/index.mjs +22 -0
- package/hooks/package.json +2 -2
- package/hooks/types.js +2 -1
- package/hooks/types.mjs +1 -0
- package/hooks/useAsyncFn.js +14 -10
- package/{node/hooks/useAsyncFn.js → hooks/useAsyncFn.mjs} +10 -14
- package/hooks/useDateLocale.js +14 -12
- package/{node/hooks/useDateLocale.js → hooks/useDateLocale.mjs} +10 -17
- package/hooks/useEffectOnce.js +8 -4
- package/hooks/useEffectOnce.mjs +9 -0
- package/hooks/useFirstMountState.js +8 -4
- package/hooks/useFirstMountState.mjs +13 -0
- package/hooks/useFixedOffset.js +21 -13
- package/{node/hooks/useFixedOffset.js → hooks/useFixedOffset.mjs} +16 -17
- package/hooks/useFocus.js +8 -4
- package/hooks/useFocus.mjs +12 -0
- package/hooks/useInterval.js +14 -10
- package/{node/hooks/useInterval.js → hooks/useInterval.mjs} +10 -14
- package/hooks/useIsomorphicLayoutEffect.js +10 -6
- package/hooks/useIsomorphicLayoutEffect.mjs +9 -0
- package/hooks/useKeyUp.js +12 -8
- package/{node/hooks/useKeyUp.js → hooks/useKeyUp.mjs} +8 -12
- package/hooks/useMeasure.js +30 -22
- package/{node/hooks/useMeasure.js → hooks/useMeasure.mjs} +26 -26
- package/hooks/useMount.js +8 -4
- package/hooks/useMount.mjs +10 -0
- package/hooks/useMountedState.js +10 -6
- package/hooks/useMountedState.mjs +16 -0
- package/hooks/useNavigateAway.js +13 -8
- package/{node/hooks/useNavigateAway.js → hooks/useNavigateAway.mjs} +8 -12
- package/hooks/usePrevious.js +8 -4
- package/hooks/usePrevious.mjs +12 -0
- package/hooks/usePreviousRef.js +9 -5
- package/hooks/usePreviousRef.mjs +9 -0
- package/hooks/useScrollPosition.js +16 -11
- package/{node/hooks/useScrollPosition.js → hooks/useScrollPosition.mjs} +11 -15
- package/hooks/useScrollThreshold.js +15 -10
- package/hooks/useScrollThreshold.mjs +28 -0
- package/hooks/useScrollTo.js +11 -6
- package/{node/hooks/useScrollTo.js → hooks/useScrollTo.mjs} +6 -10
- package/hooks/useSmoothScroll.js +18 -12
- package/hooks/useSmoothScroll.mjs +39 -0
- package/hooks/useTraceUpdate.js +9 -5
- package/{node/hooks/useTraceUpdate.js → hooks/useTraceUpdate.mjs} +5 -9
- package/hooks/useUpdateEffect.js +10 -6
- package/hooks/useUpdateEffect.mjs +15 -0
- package/hooks/useWindowSize.d.ts +1 -1
- package/hooks/useWindowSize.js +15 -9
- package/hooks/useWindowSize.mjs +29 -0
- package/index.js +4 -1
- package/{node/index.js → index.mjs} +1 -4
- package/m/MotionProvider.d.ts +1 -1
- package/m/MotionProvider.js +10 -6
- package/{node/m/MotionProvider.js → m/MotionProvider.mjs} +6 -10
- package/m/index.js +4 -1
- package/m/index.mjs +6 -0
- package/m/lite.js +4 -2
- package/m/lite.mjs +2 -0
- package/m/max.js +4 -2
- package/m/max.mjs +2 -0
- package/m/package.json +2 -2
- package/package.json +8 -7
- package/sc/index.js +36 -30
- package/sc/index.mjs +31 -0
- package/sc/package.json +2 -2
- package/scm/index.js +34 -29
- package/scm/index.mjs +31 -0
- package/scm/package.json +2 -2
- package/shared/index.js +11 -8
- package/shared/index.mjs +8 -0
- package/shared/package.json +2 -2
- package/styles/Body.js +7 -4
- package/styles/Body.mjs +13 -0
- package/styles/Global.js +7 -4
- package/styles/Global.mjs +18 -0
- package/styles/index.js +10 -7
- package/styles/index.mjs +7 -0
- package/styles/media.js +13 -8
- package/{node/styles/media.js → styles/media.mjs} +8 -13
- package/styles/package.json +2 -2
- package/styles/spacing.js +11 -4
- package/{node/styles/spacing.js → styles/spacing.mjs} +4 -11
- package/styles/styled.js +11 -7
- package/styles/styled.mjs +13 -0
- package/styles/theme--vanilla.js +32 -23
- package/styles/theme--vanilla.mjs +58 -0
- package/styles/theme.js +12 -8
- package/{node/styles/theme.js → styles/theme.mjs} +8 -12
- package/tw/index.js +7 -2
- package/{node/css/index.js → tw/index.mjs} +2 -7
- package/tw/package.json +2 -2
- package/twm/index.js +7 -2
- package/{node/twm/index.js → twm/index.mjs} +2 -7
- package/twm/package.json +2 -2
- package/types.js +2 -1
- package/types.mjs +1 -0
- package/node/Alert/Alert.js +0 -14
- package/node/Alert/index.js +0 -4
- package/node/Animations/Reveal.js +0 -21
- package/node/Animations/Underline.js +0 -8
- package/node/Animations/index.js +0 -6
- package/node/Autocomplete/components.js +0 -37
- package/node/Autocomplete/index.js +0 -7
- package/node/Bg/BgColor.js +0 -25
- package/node/Bg/BgPhoto.js +0 -20
- package/node/Bg/BgSvg.js +0 -16
- package/node/Bg/index.js +0 -6
- package/node/Breadcrumbs/Breadcrumbs.js +0 -31
- package/node/Breadcrumbs/index.js +0 -4
- package/node/Buttons/Button.js +0 -17
- package/node/Buttons/ButtonComposite.js +0 -32
- package/node/Buttons/ButtonFab.js +0 -9
- package/node/Buttons/ButtonLink.js +0 -15
- package/node/Buttons/IconButton.js +0 -10
- package/node/Buttons/index.js +0 -8
- package/node/Calendar/CalendarDaygridNav.js +0 -28
- package/node/Calendar/CalendarLegend.js +0 -20
- package/node/Calendar/index.js +0 -9
- package/node/Calendar/types.js +0 -2
- package/node/Carousel/CarouselCss.js +0 -26
- package/node/Carousel/index.js +0 -4
- package/node/Collapsable/Collapsable.js +0 -4
- package/node/Collapsable/index.js +0 -5
- package/node/Debug/Debug.js +0 -13
- package/node/Debug/index.js +0 -4
- package/node/Details/Details.js +0 -66
- package/node/Details/index.js +0 -4
- package/node/Dialog/css/bare.js +0 -24
- package/node/Dialog/index.js +0 -5
- package/node/Dialog/m/bare.js +0 -55
- package/node/Dialog/m/index.js +0 -8
- package/node/Dialog/sc/bare.js +0 -46
- package/node/Dialog/sc/framer.js +0 -19
- package/node/Dialog/sc/framerMaterial.js +0 -19
- package/node/Dialog/sc/material.js +0 -24
- package/node/Dialog/tw/bare.js +0 -45
- package/node/Dialog/tw/elegant.js +0 -23
- package/node/Dialog/tw/framer.js +0 -19
- package/node/Dialog/tw/framerMaterial.js +0 -19
- package/node/Dialog/tw/material.js +0 -23
- package/node/Editor/Editor--tiptap.js +0 -31
- package/node/Editor/components.js +0 -15
- package/node/Editor/index.js +0 -4
- package/node/FaviconTags/FaviconTags.js +0 -20
- package/node/FaviconTags/index.js +0 -7
- package/node/Form/Form.js +0 -65
- package/node/Form/index.js +0 -4
- package/node/Form/sc/bare.js +0 -23
- package/node/Forms/Checkbox/Checkbox.js +0 -21
- package/node/Forms/Checkbox/index.js +0 -4
- package/node/Forms/Feedback/Feedback.js +0 -13
- package/node/Forms/Feedback/index.js +0 -4
- package/node/Forms/Field/Field.js +0 -35
- package/node/Forms/Field/FieldControl.js +0 -51
- package/node/Forms/Field/FieldHint.js +0 -7
- package/node/Forms/Field/index.js +0 -5
- package/node/Forms/Input/Input.js +0 -20
- package/node/Forms/Input/index.js +0 -4
- package/node/Forms/InputGroup/InputGroup.js +0 -19
- package/node/Forms/InputGroup/index.js +0 -4
- package/node/Forms/Label/Label.js +0 -9
- package/node/Forms/Label/index.js +0 -4
- package/node/Forms/Password/Password.js +0 -20
- package/node/Forms/Password/index.js +0 -4
- package/node/Forms/Radio/Radio.js +0 -28
- package/node/Forms/Radio/index.js +0 -4
- package/node/Forms/Switch/Switch.js +0 -23
- package/node/Forms/Switch/index.js +0 -4
- package/node/Forms/Textarea/Textarea.js +0 -15
- package/node/Forms/Textarea/TextareaRich.js +0 -31
- package/node/Forms/Textarea/index.js +0 -5
- package/node/Forms/Toggle/Toggle.js +0 -36
- package/node/Forms/Toggle/index.js +0 -4
- package/node/Forms/index.js +0 -19
- package/node/Forms/styles.js +0 -32
- package/node/Grid/Grid.js +0 -56
- package/node/Grid/index.js +0 -4
- package/node/Hamburger/Hamburger.js +0 -56
- package/node/Hamburger/index.js +0 -4
- package/node/Header/index.js +0 -4
- package/node/Header/useHeader.js +0 -34
- package/node/Hidden/Hidden.js +0 -13
- package/node/Hidden/index.js +0 -4
- package/node/Img/index.js +0 -4
- package/node/Img/types.js +0 -2
- package/node/Link/Link.js +0 -7
- package/node/Link/LinkBlank.js +0 -21
- package/node/Link/index.js +0 -5
- package/node/Menu/Menu.js +0 -7
- package/node/Menu/MenuMui.js +0 -78
- package/node/Menu/index.js +0 -4
- package/node/MenuItem/MenuItem.js +0 -7
- package/node/MenuItem/MenuItemMui.js +0 -18
- package/node/MenuItem/index.js +0 -4
- package/node/Meta/Meta.js +0 -10
- package/node/Meta/index.js +0 -7
- package/node/NoJs/NoJs.js +0 -11
- package/node/NoJs/index.js +0 -7
- package/node/Pagination/PaginationNav.js +0 -65
- package/node/Pagination/PaginationResults.js +0 -15
- package/node/Pagination/index.js +0 -5
- package/node/Pill/Pill.js +0 -10
- package/node/Pill/index.js +0 -4
- package/node/Progress/ProgressCircular.js +0 -19
- package/node/Progress/ProgressLinear.js +0 -28
- package/node/Progress/ProgressOverlay.js +0 -28
- package/node/Progress/index.js +0 -6
- package/node/Rating/Rating.js +0 -75
- package/node/Select/components.js +0 -15
- package/node/Select/index.js +0 -7
- package/node/Sidebar/Sidebar.js +0 -27
- package/node/Sidebar/index.js +0 -4
- package/node/Spacing/Spacing.js +0 -49
- package/node/Spacing/index.js +0 -4
- package/node/Sticky/StickyCss.js +0 -10
- package/node/Sticky/index.js +0 -4
- package/node/Tabs/TabsMui.js +0 -49
- package/node/Tabs/index.js +0 -4
- package/node/Tabs/tw/bare.js +0 -20
- package/node/Tabs/tw/material.js +0 -21
- package/node/Typography/CopyPasteVisible.js +0 -7
- package/node/Typography/Native.js +0 -17
- package/node/Typography/ReadMore.js +0 -47
- package/node/Typography/index.js +0 -8
- package/node/helpers/extend-component.js +0 -17
- package/node/helpers/index.js +0 -7
- package/node/hooks/index.js +0 -25
- package/node/hooks/types.js +0 -2
- package/node/hooks/useEffectOnce.js +0 -13
- package/node/hooks/useFirstMountState.js +0 -17
- package/node/hooks/useFocus.js +0 -16
- package/node/hooks/useIsomorphicLayoutEffect.js +0 -12
- package/node/hooks/useMount.js +0 -14
- package/node/hooks/useMountedState.js +0 -20
- package/node/hooks/usePrevious.js +0 -16
- package/node/hooks/usePreviousRef.js +0 -13
- package/node/hooks/useScrollThreshold.js +0 -32
- package/node/hooks/useSmoothScroll.js +0 -42
- package/node/hooks/useUpdateEffect.js +0 -19
- package/node/hooks/useWindowSize.js +0 -32
- package/node/m/index.js +0 -9
- package/node/m/lite.js +0 -4
- package/node/m/max.js +0 -4
- package/node/sc/index.js +0 -37
- package/node/scm/index.js +0 -36
- package/node/shared/index.js +0 -11
- package/node/styles/Body.js +0 -16
- package/node/styles/Global.js +0 -21
- package/node/styles/index.js +0 -10
- package/node/styles/styled.js +0 -17
- package/node/styles/theme--vanilla.js +0 -61
- package/node/types.js +0 -2
package/hooks/useFocus.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useFocus = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
2
5
|
/**
|
|
3
6
|
* @see https://stackoverflow.com/a/54159564/1938970
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
var element = useRef(null);
|
|
8
|
+
var useFocus = function () {
|
|
9
|
+
var element = (0, react_1.useRef)(null);
|
|
7
10
|
var setFocus = function () {
|
|
8
11
|
element.current && element.current.focus();
|
|
9
12
|
};
|
|
10
13
|
return [element, setFocus];
|
|
11
14
|
};
|
|
12
|
-
|
|
15
|
+
exports.useFocus = useFocus;
|
|
16
|
+
exports.default = exports.useFocus;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { useRef } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @see https://stackoverflow.com/a/54159564/1938970
|
|
4
|
+
*/
|
|
5
|
+
export var useFocus = function () {
|
|
6
|
+
var element = useRef(null);
|
|
7
|
+
var setFocus = function () {
|
|
8
|
+
element.current && element.current.focus();
|
|
9
|
+
};
|
|
10
|
+
return [element, setFocus];
|
|
11
|
+
};
|
|
12
|
+
export default useFocus;
|
package/hooks/useInterval.js
CHANGED
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInterval = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var noop_1 = tslib_1.__importDefault(require("@koine/utils/noop"));
|
|
4
7
|
/**
|
|
5
8
|
* @borrows [dan abramov](https://overreacted.io/making-setinterval-declarative-with-react-hooks/)
|
|
6
9
|
*
|
|
7
10
|
* We just add `deps` array argument and typescript support
|
|
8
11
|
*/
|
|
9
|
-
|
|
12
|
+
function useInterval(callback, delay, deps) {
|
|
10
13
|
if (deps === void 0) { deps = []; }
|
|
11
|
-
var savedCallback = useRef();
|
|
12
|
-
useEffect(function () {
|
|
14
|
+
var savedCallback = (0, react_1.useRef)();
|
|
15
|
+
(0, react_1.useEffect)(function () {
|
|
13
16
|
savedCallback.current = callback;
|
|
14
17
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
|
-
}, __spreadArray([callback], deps, true));
|
|
16
|
-
useEffect(function () {
|
|
18
|
+
}, tslib_1.__spreadArray([callback], deps, true));
|
|
19
|
+
(0, react_1.useEffect)(function () {
|
|
17
20
|
function tick() {
|
|
18
21
|
if (savedCallback.current)
|
|
19
22
|
savedCallback.current();
|
|
@@ -22,7 +25,8 @@ export function useInterval(callback, delay, deps) {
|
|
|
22
25
|
var id_1 = setInterval(tick, delay);
|
|
23
26
|
return function () { return clearInterval(id_1); };
|
|
24
27
|
}
|
|
25
|
-
return
|
|
28
|
+
return noop_1.default;
|
|
26
29
|
}, [delay]);
|
|
27
30
|
}
|
|
28
|
-
|
|
31
|
+
exports.useInterval = useInterval;
|
|
32
|
+
exports.default = useInterval;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var tslib_1 = require("tslib");
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
var utils_1 = require("@koine/utils");
|
|
1
|
+
import { __spreadArray } from "tslib";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
3
|
+
import noop from "@koine/utils/noop";
|
|
7
4
|
/**
|
|
8
5
|
* @borrows [dan abramov](https://overreacted.io/making-setinterval-declarative-with-react-hooks/)
|
|
9
6
|
*
|
|
10
7
|
* We just add `deps` array argument and typescript support
|
|
11
8
|
*/
|
|
12
|
-
function useInterval(callback, delay, deps) {
|
|
9
|
+
export function useInterval(callback, delay, deps) {
|
|
13
10
|
if (deps === void 0) { deps = []; }
|
|
14
|
-
var savedCallback =
|
|
15
|
-
|
|
11
|
+
var savedCallback = useRef();
|
|
12
|
+
useEffect(function () {
|
|
16
13
|
savedCallback.current = callback;
|
|
17
14
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18
|
-
},
|
|
19
|
-
|
|
15
|
+
}, __spreadArray([callback], deps, true));
|
|
16
|
+
useEffect(function () {
|
|
20
17
|
function tick() {
|
|
21
18
|
if (savedCallback.current)
|
|
22
19
|
savedCallback.current();
|
|
@@ -25,8 +22,7 @@ function useInterval(callback, delay, deps) {
|
|
|
25
22
|
var id_1 = setInterval(tick, delay);
|
|
26
23
|
return function () { return clearInterval(id_1); };
|
|
27
24
|
}
|
|
28
|
-
return
|
|
25
|
+
return noop;
|
|
29
26
|
}, [delay]);
|
|
30
27
|
}
|
|
31
|
-
|
|
32
|
-
exports.default = useInterval;
|
|
28
|
+
export default useInterval;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsomorphicLayoutEffect = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var isBrowser_1 = tslib_1.__importDefault(require("@koine/utils/isBrowser"));
|
|
3
7
|
/**
|
|
4
8
|
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useFirstMountState.ts)
|
|
5
9
|
*/
|
|
6
|
-
|
|
7
|
-
? useLayoutEffect
|
|
8
|
-
: useEffect;
|
|
9
|
-
|
|
10
|
+
exports.useIsomorphicLayoutEffect = isBrowser_1.default
|
|
11
|
+
? react_1.useLayoutEffect
|
|
12
|
+
: react_1.useEffect;
|
|
13
|
+
exports.default = exports.useIsomorphicLayoutEffect;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { useEffect, useLayoutEffect } from "react";
|
|
2
|
+
import isBrowser from "@koine/utils/isBrowser";
|
|
3
|
+
/**
|
|
4
|
+
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useFirstMountState.ts)
|
|
5
|
+
*/
|
|
6
|
+
export var useIsomorphicLayoutEffect = isBrowser
|
|
7
|
+
? useLayoutEffect
|
|
8
|
+
: useEffect;
|
|
9
|
+
export default useIsomorphicLayoutEffect;
|
package/hooks/useKeyUp.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useKeyUp = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
|
|
7
|
+
function useKeyUp(callback, deps) {
|
|
5
8
|
if (deps === void 0) { deps = []; }
|
|
6
|
-
useEffect(function () {
|
|
7
|
-
var listener =
|
|
9
|
+
(0, react_1.useEffect)(function () {
|
|
10
|
+
var listener = (0, on_1.default)(window, "keyup", function (event) {
|
|
8
11
|
// const { key } = event;
|
|
9
12
|
// be sure we do not intercept keys combinations maybe used for other
|
|
10
13
|
// actions like native browser navigation shortcuts
|
|
@@ -18,6 +21,7 @@ export function useKeyUp(callback, deps) {
|
|
|
18
21
|
});
|
|
19
22
|
return listener;
|
|
20
23
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
21
|
-
}, __spreadArray([callback], deps, true));
|
|
24
|
+
}, tslib_1.__spreadArray([callback], deps, true));
|
|
22
25
|
}
|
|
23
|
-
|
|
26
|
+
exports.useKeyUp = useKeyUp;
|
|
27
|
+
exports.default = useKeyUp;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
var react_1 = require("react");
|
|
6
|
-
var dom_1 = require("@koine/dom");
|
|
7
|
-
function useKeyUp(callback, deps) {
|
|
1
|
+
import { __spreadArray } from "tslib";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import on from "@koine/dom/on";
|
|
4
|
+
export function useKeyUp(callback, deps) {
|
|
8
5
|
if (deps === void 0) { deps = []; }
|
|
9
|
-
|
|
10
|
-
var listener =
|
|
6
|
+
useEffect(function () {
|
|
7
|
+
var listener = on(window, "keyup", function (event) {
|
|
11
8
|
// const { key } = event;
|
|
12
9
|
// be sure we do not intercept keys combinations maybe used for other
|
|
13
10
|
// actions like native browser navigation shortcuts
|
|
@@ -21,7 +18,6 @@ function useKeyUp(callback, deps) {
|
|
|
21
18
|
});
|
|
22
19
|
return listener;
|
|
23
20
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
24
|
-
},
|
|
21
|
+
}, __spreadArray([callback], deps, true));
|
|
25
22
|
}
|
|
26
|
-
|
|
27
|
-
exports.default = useKeyUp;
|
|
23
|
+
export default useKeyUp;
|
package/hooks/useMeasure.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMeasure = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var debounce_1 = tslib_1.__importDefault(require("@koine/utils/debounce"));
|
|
7
|
+
var noop_1 = tslib_1.__importDefault(require("@koine/utils/noop"));
|
|
8
|
+
var listenResizeDebounced_1 = tslib_1.__importDefault(require("@koine/dom/listenResizeDebounced"));
|
|
9
|
+
var listenScrollDebounced_1 = tslib_1.__importDefault(require("@koine/dom/listenScrollDebounced"));
|
|
10
|
+
var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
|
|
11
|
+
var off_1 = tslib_1.__importDefault(require("@koine/dom/off"));
|
|
5
12
|
var observer;
|
|
6
13
|
// Returns a list of scroll offsets
|
|
7
14
|
function findScrollContainers(element) {
|
|
@@ -11,7 +18,7 @@ function findScrollContainers(element) {
|
|
|
11
18
|
var _a = window.getComputedStyle(element), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
|
|
12
19
|
if ([overflow, overflowX, overflowY].some(function (prop) { return prop === "auto" || prop === "scroll"; }))
|
|
13
20
|
result.push(element);
|
|
14
|
-
return __spreadArray(__spreadArray([], result, true), findScrollContainers(element.parentElement), true);
|
|
21
|
+
return tslib_1.__spreadArray(tslib_1.__spreadArray([], result, true), findScrollContainers(element.parentElement), true);
|
|
15
22
|
}
|
|
16
23
|
var keys = [
|
|
17
24
|
"x",
|
|
@@ -31,9 +38,9 @@ var areBoundsEqual = function (a, b) {
|
|
|
31
38
|
*
|
|
32
39
|
* @borrows [pmndrs/react-use-measure](https://github.com/pmndrs/react-use-measure)
|
|
33
40
|
*/
|
|
34
|
-
|
|
41
|
+
function useMeasure(options) {
|
|
35
42
|
var _a = (options || {}).scroll /* offsetSize = false */, scroll = _a === void 0 ? false : _a /* offsetSize = false */;
|
|
36
|
-
var _b = useState({
|
|
43
|
+
var _b = (0, react_1.useState)({
|
|
37
44
|
left: 0,
|
|
38
45
|
top: 0,
|
|
39
46
|
width: 0,
|
|
@@ -44,7 +51,7 @@ export function useMeasure(options) {
|
|
|
44
51
|
y: 0,
|
|
45
52
|
}), bounds = _b[0], setBounds = _b[1];
|
|
46
53
|
// keep all state in a ref
|
|
47
|
-
var state = useRef([
|
|
54
|
+
var state = (0, react_1.useRef)([
|
|
48
55
|
// element
|
|
49
56
|
null,
|
|
50
57
|
// scrollContainers
|
|
@@ -55,13 +62,13 @@ export function useMeasure(options) {
|
|
|
55
62
|
bounds,
|
|
56
63
|
]);
|
|
57
64
|
// make sure to update state only as long as the component is truly mounted
|
|
58
|
-
var mounted = useRef(false);
|
|
59
|
-
useEffect(function () {
|
|
65
|
+
var mounted = (0, react_1.useRef)(false);
|
|
66
|
+
(0, react_1.useEffect)(function () {
|
|
60
67
|
mounted.current = true;
|
|
61
68
|
return function () { return void (mounted.current = false); };
|
|
62
69
|
}, []);
|
|
63
70
|
// memoize handlers, so event-listeners know when they should update
|
|
64
|
-
var _c = useMemo(function () {
|
|
71
|
+
var _c = (0, react_1.useMemo)(function () {
|
|
65
72
|
var callback = function () {
|
|
66
73
|
var _args = [];
|
|
67
74
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -81,7 +88,7 @@ export function useMeasure(options) {
|
|
|
81
88
|
setBounds(size);
|
|
82
89
|
}
|
|
83
90
|
};
|
|
84
|
-
var debouncedCallback =
|
|
91
|
+
var debouncedCallback = (0, debounce_1.default)(callback);
|
|
85
92
|
return [callback, debouncedCallback, debouncedCallback];
|
|
86
93
|
}, [setBounds /* , offsetSize */]), forceRefresh = _c[0] /* resizeChange */, scrollChange = _c[2];
|
|
87
94
|
// cleanup current scroll-listeners / observers
|
|
@@ -89,7 +96,7 @@ export function useMeasure(options) {
|
|
|
89
96
|
var _a = state.current, scrollContainers = _a[1], resizeObserver = _a[2];
|
|
90
97
|
if (scrollContainers) {
|
|
91
98
|
scrollContainers.forEach(function (element) {
|
|
92
|
-
return
|
|
99
|
+
return (0, off_1.default)(element, "scroll", scrollChange);
|
|
93
100
|
});
|
|
94
101
|
state.current[1] = null;
|
|
95
102
|
}
|
|
@@ -109,7 +116,7 @@ export function useMeasure(options) {
|
|
|
109
116
|
observer.observe(element);
|
|
110
117
|
if (scroll && scrollContainers) {
|
|
111
118
|
scrollContainers.forEach(function (scrollContainer) {
|
|
112
|
-
return
|
|
119
|
+
return (0, on_1.default)(scrollContainer, "scroll", scrollChange, {
|
|
113
120
|
capture: true,
|
|
114
121
|
passive: true,
|
|
115
122
|
});
|
|
@@ -132,26 +139,26 @@ export function useMeasure(options) {
|
|
|
132
139
|
// debugger;
|
|
133
140
|
// forceRefresh();
|
|
134
141
|
// });
|
|
135
|
-
useEffect(function () {
|
|
142
|
+
(0, react_1.useEffect)(function () {
|
|
136
143
|
if (scroll) {
|
|
137
|
-
var listener =
|
|
144
|
+
var listener = (0, listenScrollDebounced_1.default)(0, forceRefresh, 100);
|
|
138
145
|
return listener;
|
|
139
146
|
}
|
|
140
|
-
return
|
|
147
|
+
return noop_1.default;
|
|
141
148
|
}, [scroll, forceRefresh]);
|
|
142
|
-
useEffect(function () {
|
|
149
|
+
(0, react_1.useEffect)(function () {
|
|
143
150
|
// const listener = listenResizeDebounced(onWindowResize);
|
|
144
151
|
// return listener;
|
|
145
|
-
var listener =
|
|
152
|
+
var listener = (0, listenResizeDebounced_1.default)(0, forceRefresh, 100);
|
|
146
153
|
return listener;
|
|
147
154
|
}, [forceRefresh]);
|
|
148
155
|
// respond to changes that are relevant for the listeners
|
|
149
|
-
useEffect(function () {
|
|
156
|
+
(0, react_1.useEffect)(function () {
|
|
150
157
|
removeListeners();
|
|
151
158
|
addListeners();
|
|
152
159
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
153
160
|
}, [scroll /* , scrollChange, resizeChange */]);
|
|
154
|
-
useEffect(function () {
|
|
161
|
+
(0, react_1.useEffect)(function () {
|
|
155
162
|
// operate on mount, @kuus on the original version there is no call on mount?
|
|
156
163
|
forceRefresh();
|
|
157
164
|
// remove all listeners when the components unmounts
|
|
@@ -160,4 +167,5 @@ export function useMeasure(options) {
|
|
|
160
167
|
}, []);
|
|
161
168
|
return [ref, bounds, forceRefresh];
|
|
162
169
|
}
|
|
163
|
-
|
|
170
|
+
exports.useMeasure = useMeasure;
|
|
171
|
+
exports.default = useMeasure;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { __spreadArray } from "tslib";
|
|
2
|
+
import { useEffect, useState, useRef, useMemo } from "react";
|
|
3
|
+
import debounce from "@koine/utils/debounce";
|
|
4
|
+
import noop from "@koine/utils/noop";
|
|
5
|
+
import listenResizeDebounced from "@koine/dom/listenResizeDebounced";
|
|
6
|
+
import listenScrollDebounced from "@koine/dom/listenScrollDebounced";
|
|
7
|
+
import on from "@koine/dom/on";
|
|
8
|
+
import off from "@koine/dom/off";
|
|
8
9
|
var observer;
|
|
9
10
|
// Returns a list of scroll offsets
|
|
10
11
|
function findScrollContainers(element) {
|
|
@@ -14,7 +15,7 @@ function findScrollContainers(element) {
|
|
|
14
15
|
var _a = window.getComputedStyle(element), overflow = _a.overflow, overflowX = _a.overflowX, overflowY = _a.overflowY;
|
|
15
16
|
if ([overflow, overflowX, overflowY].some(function (prop) { return prop === "auto" || prop === "scroll"; }))
|
|
16
17
|
result.push(element);
|
|
17
|
-
return
|
|
18
|
+
return __spreadArray(__spreadArray([], result, true), findScrollContainers(element.parentElement), true);
|
|
18
19
|
}
|
|
19
20
|
var keys = [
|
|
20
21
|
"x",
|
|
@@ -34,9 +35,9 @@ var areBoundsEqual = function (a, b) {
|
|
|
34
35
|
*
|
|
35
36
|
* @borrows [pmndrs/react-use-measure](https://github.com/pmndrs/react-use-measure)
|
|
36
37
|
*/
|
|
37
|
-
function useMeasure(options) {
|
|
38
|
+
export function useMeasure(options) {
|
|
38
39
|
var _a = (options || {}).scroll /* offsetSize = false */, scroll = _a === void 0 ? false : _a /* offsetSize = false */;
|
|
39
|
-
var _b =
|
|
40
|
+
var _b = useState({
|
|
40
41
|
left: 0,
|
|
41
42
|
top: 0,
|
|
42
43
|
width: 0,
|
|
@@ -47,7 +48,7 @@ function useMeasure(options) {
|
|
|
47
48
|
y: 0,
|
|
48
49
|
}), bounds = _b[0], setBounds = _b[1];
|
|
49
50
|
// keep all state in a ref
|
|
50
|
-
var state =
|
|
51
|
+
var state = useRef([
|
|
51
52
|
// element
|
|
52
53
|
null,
|
|
53
54
|
// scrollContainers
|
|
@@ -58,13 +59,13 @@ function useMeasure(options) {
|
|
|
58
59
|
bounds,
|
|
59
60
|
]);
|
|
60
61
|
// make sure to update state only as long as the component is truly mounted
|
|
61
|
-
var mounted =
|
|
62
|
-
|
|
62
|
+
var mounted = useRef(false);
|
|
63
|
+
useEffect(function () {
|
|
63
64
|
mounted.current = true;
|
|
64
65
|
return function () { return void (mounted.current = false); };
|
|
65
66
|
}, []);
|
|
66
67
|
// memoize handlers, so event-listeners know when they should update
|
|
67
|
-
var _c =
|
|
68
|
+
var _c = useMemo(function () {
|
|
68
69
|
var callback = function () {
|
|
69
70
|
var _args = [];
|
|
70
71
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -84,7 +85,7 @@ function useMeasure(options) {
|
|
|
84
85
|
setBounds(size);
|
|
85
86
|
}
|
|
86
87
|
};
|
|
87
|
-
var debouncedCallback =
|
|
88
|
+
var debouncedCallback = debounce(callback);
|
|
88
89
|
return [callback, debouncedCallback, debouncedCallback];
|
|
89
90
|
}, [setBounds /* , offsetSize */]), forceRefresh = _c[0] /* resizeChange */, scrollChange = _c[2];
|
|
90
91
|
// cleanup current scroll-listeners / observers
|
|
@@ -92,7 +93,7 @@ function useMeasure(options) {
|
|
|
92
93
|
var _a = state.current, scrollContainers = _a[1], resizeObserver = _a[2];
|
|
93
94
|
if (scrollContainers) {
|
|
94
95
|
scrollContainers.forEach(function (element) {
|
|
95
|
-
return
|
|
96
|
+
return off(element, "scroll", scrollChange);
|
|
96
97
|
});
|
|
97
98
|
state.current[1] = null;
|
|
98
99
|
}
|
|
@@ -112,7 +113,7 @@ function useMeasure(options) {
|
|
|
112
113
|
observer.observe(element);
|
|
113
114
|
if (scroll && scrollContainers) {
|
|
114
115
|
scrollContainers.forEach(function (scrollContainer) {
|
|
115
|
-
return
|
|
116
|
+
return on(scrollContainer, "scroll", scrollChange, {
|
|
116
117
|
capture: true,
|
|
117
118
|
passive: true,
|
|
118
119
|
});
|
|
@@ -135,26 +136,26 @@ function useMeasure(options) {
|
|
|
135
136
|
// debugger;
|
|
136
137
|
// forceRefresh();
|
|
137
138
|
// });
|
|
138
|
-
|
|
139
|
+
useEffect(function () {
|
|
139
140
|
if (scroll) {
|
|
140
|
-
var listener =
|
|
141
|
+
var listener = listenScrollDebounced(0, forceRefresh, 100);
|
|
141
142
|
return listener;
|
|
142
143
|
}
|
|
143
|
-
return
|
|
144
|
+
return noop;
|
|
144
145
|
}, [scroll, forceRefresh]);
|
|
145
|
-
|
|
146
|
+
useEffect(function () {
|
|
146
147
|
// const listener = listenResizeDebounced(onWindowResize);
|
|
147
148
|
// return listener;
|
|
148
|
-
var listener =
|
|
149
|
+
var listener = listenResizeDebounced(0, forceRefresh, 100);
|
|
149
150
|
return listener;
|
|
150
151
|
}, [forceRefresh]);
|
|
151
152
|
// respond to changes that are relevant for the listeners
|
|
152
|
-
|
|
153
|
+
useEffect(function () {
|
|
153
154
|
removeListeners();
|
|
154
155
|
addListeners();
|
|
155
156
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
156
157
|
}, [scroll /* , scrollChange, resizeChange */]);
|
|
157
|
-
|
|
158
|
+
useEffect(function () {
|
|
158
159
|
// operate on mount, @kuus on the original version there is no call on mount?
|
|
159
160
|
forceRefresh();
|
|
160
161
|
// remove all listeners when the components unmounts
|
|
@@ -163,5 +164,4 @@ function useMeasure(options) {
|
|
|
163
164
|
}, []);
|
|
164
165
|
return [ref, bounds, forceRefresh];
|
|
165
166
|
}
|
|
166
|
-
|
|
167
|
-
exports.default = useMeasure;
|
|
167
|
+
export default useMeasure;
|
package/hooks/useMount.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMount = void 0;
|
|
4
|
+
var useEffectOnce_1 = require("./useEffectOnce");
|
|
2
5
|
/**
|
|
3
6
|
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMount.ts)
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
useEffectOnce(function () {
|
|
8
|
+
var useMount = function (fn) {
|
|
9
|
+
(0, useEffectOnce_1.useEffectOnce)(function () {
|
|
7
10
|
fn();
|
|
8
11
|
});
|
|
9
12
|
};
|
|
10
|
-
|
|
13
|
+
exports.useMount = useMount;
|
|
14
|
+
exports.default = exports.useMount;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useEffectOnce } from "./useEffectOnce";
|
|
2
|
+
/**
|
|
3
|
+
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMount.ts)
|
|
4
|
+
*/
|
|
5
|
+
export var useMount = function (fn) {
|
|
6
|
+
useEffectOnce(function () {
|
|
7
|
+
fn();
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
export default useMount;
|
package/hooks/useMountedState.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMountedState = void 0;
|
|
4
|
+
var react_1 = require("react");
|
|
2
5
|
/**
|
|
3
6
|
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMountedState.ts)
|
|
4
7
|
*/
|
|
5
|
-
|
|
6
|
-
var mountedRef = useRef(false);
|
|
7
|
-
var get = useCallback(function () { return mountedRef.current; }, []);
|
|
8
|
-
useEffect(function () {
|
|
8
|
+
function useMountedState() {
|
|
9
|
+
var mountedRef = (0, react_1.useRef)(false);
|
|
10
|
+
var get = (0, react_1.useCallback)(function () { return mountedRef.current; }, []);
|
|
11
|
+
(0, react_1.useEffect)(function () {
|
|
9
12
|
mountedRef.current = true;
|
|
10
13
|
return function () {
|
|
11
14
|
mountedRef.current = false;
|
|
@@ -13,4 +16,5 @@ export function useMountedState() {
|
|
|
13
16
|
}, []);
|
|
14
17
|
return get;
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
exports.useMountedState = useMountedState;
|
|
20
|
+
exports.default = useMountedState;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { useCallback, useEffect, useRef } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* @borrows [streamich/react-use](https://github.com/streamich/react-use/blob/master/src/useMountedState.ts)
|
|
4
|
+
*/
|
|
5
|
+
export function useMountedState() {
|
|
6
|
+
var mountedRef = useRef(false);
|
|
7
|
+
var get = useCallback(function () { return mountedRef.current; }, []);
|
|
8
|
+
useEffect(function () {
|
|
9
|
+
mountedRef.current = true;
|
|
10
|
+
return function () {
|
|
11
|
+
mountedRef.current = false;
|
|
12
|
+
};
|
|
13
|
+
}, []);
|
|
14
|
+
return get;
|
|
15
|
+
}
|
|
16
|
+
export default useMountedState;
|
package/hooks/useNavigateAway.js
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useNavigateAway = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var react_1 = require("react");
|
|
6
|
+
var on_1 = tslib_1.__importDefault(require("@koine/dom/on"));
|
|
3
7
|
// type UseNavigateAwayPagehideHandler = (event: PageTransitionEvent) => unknown;
|
|
4
8
|
/**
|
|
5
9
|
* @resources
|
|
@@ -20,10 +24,10 @@ import { on } from "@koine/dom";
|
|
|
20
24
|
* For the callback technique see:
|
|
21
25
|
* - https://stackoverflow.com/a/11835394/1938970
|
|
22
26
|
*/
|
|
23
|
-
|
|
24
|
-
var beforeUnloadHandlerRef = useRef();
|
|
27
|
+
var useNavigateAway = function (handler) {
|
|
28
|
+
var beforeUnloadHandlerRef = (0, react_1.useRef)();
|
|
25
29
|
// const pagehideHandlerRef = useRef<UseNavigateAwayPagehideHandler | undefined>();
|
|
26
|
-
useEffect(function () {
|
|
30
|
+
(0, react_1.useEffect)(function () {
|
|
27
31
|
beforeUnloadHandlerRef.current = function (event) {
|
|
28
32
|
var customMessageOrCondition = handler(event);
|
|
29
33
|
if (customMessageOrCondition) {
|
|
@@ -53,8 +57,8 @@ export var useNavigateAway = function (handler) {
|
|
|
53
57
|
// }
|
|
54
58
|
// };
|
|
55
59
|
}, [handler]);
|
|
56
|
-
useEffect(function () {
|
|
57
|
-
var listenerBeforeunload =
|
|
60
|
+
(0, react_1.useEffect)(function () {
|
|
61
|
+
var listenerBeforeunload = (0, on_1.default)(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
|
|
58
62
|
// const listenerPagehide = on(window, "pagehide", (event) =>
|
|
59
63
|
// pagehideHandlerRef.current?.(event)
|
|
60
64
|
// );
|
|
@@ -65,4 +69,5 @@ export var useNavigateAway = function (handler) {
|
|
|
65
69
|
// };
|
|
66
70
|
}, []);
|
|
67
71
|
};
|
|
68
|
-
|
|
72
|
+
exports.useNavigateAway = useNavigateAway;
|
|
73
|
+
exports.default = exports.useNavigateAway;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.useNavigateAway = void 0;
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var dom_1 = require("@koine/dom");
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import on from "@koine/dom/on";
|
|
6
3
|
// type UseNavigateAwayPagehideHandler = (event: PageTransitionEvent) => unknown;
|
|
7
4
|
/**
|
|
8
5
|
* @resources
|
|
@@ -23,10 +20,10 @@ var dom_1 = require("@koine/dom");
|
|
|
23
20
|
* For the callback technique see:
|
|
24
21
|
* - https://stackoverflow.com/a/11835394/1938970
|
|
25
22
|
*/
|
|
26
|
-
var useNavigateAway = function (handler) {
|
|
27
|
-
var beforeUnloadHandlerRef =
|
|
23
|
+
export var useNavigateAway = function (handler) {
|
|
24
|
+
var beforeUnloadHandlerRef = useRef();
|
|
28
25
|
// const pagehideHandlerRef = useRef<UseNavigateAwayPagehideHandler | undefined>();
|
|
29
|
-
|
|
26
|
+
useEffect(function () {
|
|
30
27
|
beforeUnloadHandlerRef.current = function (event) {
|
|
31
28
|
var customMessageOrCondition = handler(event);
|
|
32
29
|
if (customMessageOrCondition) {
|
|
@@ -56,8 +53,8 @@ var useNavigateAway = function (handler) {
|
|
|
56
53
|
// }
|
|
57
54
|
// };
|
|
58
55
|
}, [handler]);
|
|
59
|
-
|
|
60
|
-
var listenerBeforeunload =
|
|
56
|
+
useEffect(function () {
|
|
57
|
+
var listenerBeforeunload = on(window, "beforeunload", function (event) { var _a; return (_a = beforeUnloadHandlerRef.current) === null || _a === void 0 ? void 0 : _a.call(beforeUnloadHandlerRef, event); });
|
|
61
58
|
// const listenerPagehide = on(window, "pagehide", (event) =>
|
|
62
59
|
// pagehideHandlerRef.current?.(event)
|
|
63
60
|
// );
|
|
@@ -68,5 +65,4 @@ var useNavigateAway = function (handler) {
|
|
|
68
65
|
// };
|
|
69
66
|
}, []);
|
|
70
67
|
};
|
|
71
|
-
|
|
72
|
-
exports.default = exports.useNavigateAway;
|
|
68
|
+
export default useNavigateAway;
|