@adamjanicki/ui 1.4.1 → 1.4.3

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.
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const DoubleCross: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default DoubleCross;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { defaultAngles } from "./Hamburger";
26
+ var DoubleCross = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = defaultAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ bottom: { transform: bottomTransform },
35
+ };
36
+ }, [direction]);
37
+ return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
38
+ };
39
+ export default DoubleCross;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const DoubleFlip: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default DoubleFlip;
@@ -0,0 +1,39 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { flipAngles } from "./Hamburger";
26
+ var DoubleFlip = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = flipAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ bottom: { transform: bottomTransform },
35
+ };
36
+ }, [direction]);
37
+ return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
38
+ };
39
+ export default DoubleFlip;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const DoubleSpin: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default DoubleSpin;
@@ -0,0 +1,40 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { defaultAngles } from "./Hamburger";
26
+ var DoubleSpin = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = defaultAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ bottom: { transform: bottomTransform },
35
+ outer: { transform: "rotate(180deg)" },
36
+ };
37
+ }, [direction]);
38
+ return _jsx(Hamburger, __assign({}, rest, { double: true, openStyle: openStyle }));
39
+ };
40
+ export default DoubleSpin;
@@ -0,0 +1,58 @@
1
+ export type Props = {
2
+ /**
3
+ * Size of the button in pixels
4
+ * @default 36
5
+ */
6
+ size?: number;
7
+ /**
8
+ * Direction the animation originates from;
9
+ * play around with this to see how it affects the animation because some of the animations are complicated
10
+ * @default "left"
11
+ */
12
+ direction?: "left" | "right";
13
+ /**
14
+ * Whether the button is open or closed
15
+ */
16
+ open: boolean;
17
+ /**
18
+ * Function to call when the button is clicked, usually should toggle the `open` state
19
+ */
20
+ onClick?: () => void;
21
+ /**
22
+ * Aria label for the button
23
+ */
24
+ "aria-label": string;
25
+ /**
26
+ * Duration of the animation in seconds
27
+ * @default 0.25
28
+ */
29
+ duration?: number;
30
+ /**
31
+ * [Optional] additional class name to apply to the button
32
+ */
33
+ className?: string;
34
+ /**
35
+ * [Optional] additional styles to apply to the button
36
+ */
37
+ style?: React.CSSProperties;
38
+ };
39
+ type OpenStyle = {
40
+ outer?: React.CSSProperties;
41
+ top: React.CSSProperties;
42
+ bottom: React.CSSProperties;
43
+ middle?: React.CSSProperties;
44
+ };
45
+ type InnerProps = Omit<Props, "variant" | "direction"> & {
46
+ double?: boolean;
47
+ openStyle: OpenStyle;
48
+ };
49
+ export declare const defaultAngles: {
50
+ readonly right: 45;
51
+ readonly left: -45;
52
+ };
53
+ export declare const flipAngles: {
54
+ readonly right: -135;
55
+ readonly left: -225;
56
+ };
57
+ declare const Hamburger: (props: InnerProps) => import("react/jsx-runtime").JSX.Element;
58
+ export default Hamburger;
@@ -0,0 +1,65 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import { UnstyledButton } from "../Button";
26
+ export var defaultAngles = {
27
+ right: 45,
28
+ left: -45,
29
+ };
30
+ export var flipAngles = {
31
+ right: -135,
32
+ left: -225,
33
+ };
34
+ var Hamburger = function (props) {
35
+ var _a = props.size, size = _a === void 0 ? 36 : _a, _b = props.duration, duration = _b === void 0 ? 0.25 : _b, double = props.double, openStyle = props.openStyle, open = props.open, style = props.style, buttonProps = __rest(props, ["size", "duration", "double", "openStyle", "open", "style"]);
36
+ var lineHeight = Math.max(1, Math.round(size / 20));
37
+ var buttonStyle = {
38
+ width: size,
39
+ height: size,
40
+ display: "flex",
41
+ position: "relative",
42
+ justifyContent: "center",
43
+ alignItems: "center",
44
+ transition: "all ".concat(duration, "s ease"),
45
+ };
46
+ var commonLineStyle = {
47
+ height: lineHeight,
48
+ width: size * 0.7,
49
+ backgroundColor: "currentColor",
50
+ position: "absolute",
51
+ transition: "all ".concat(duration, "s ease"),
52
+ };
53
+ var yTranslateMagnitude = useMemo(function () { return size / (double ? 7 : 4); }, [size, double]);
54
+ var outer = openStyle.outer, top = openStyle.top, middle = openStyle.middle, bottom = openStyle.bottom;
55
+ var outerStyle = open ? outer : {};
56
+ var topStyle = open
57
+ ? top
58
+ : { transform: "translateY(-".concat(yTranslateMagnitude, "px)") };
59
+ var bottomStyle = open
60
+ ? bottom
61
+ : { transform: "translateY(".concat(yTranslateMagnitude, "px)") };
62
+ var middleStyle = open ? middle : {};
63
+ return (_jsxs(UnstyledButton, __assign({ style: __assign(__assign(__assign({}, style), outerStyle), buttonStyle) }, buttonProps, { children: [_jsx("span", { style: __assign(__assign({}, commonLineStyle), topStyle) }), !double && _jsx("span", { style: __assign(__assign({}, commonLineStyle), middleStyle) }), _jsx("span", { style: __assign(__assign({}, commonLineStyle), bottomStyle) })] })));
64
+ };
65
+ export default Hamburger;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const TripleFade: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default TripleFade;
@@ -0,0 +1,40 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { defaultAngles } from "./Hamburger";
26
+ var TripleFade = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = defaultAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ middle: { opacity: 0 },
35
+ bottom: { transform: bottomTransform },
36
+ };
37
+ }, [direction]);
38
+ return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
39
+ };
40
+ export default TripleFade;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const TripleFlip: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default TripleFlip;
@@ -0,0 +1,40 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { flipAngles } from "./Hamburger";
26
+ var TripleFlip = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = flipAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ middle: { transform: "scale(0)" },
35
+ bottom: { transform: bottomTransform },
36
+ };
37
+ }, [direction]);
38
+ return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
39
+ };
40
+ export default TripleFlip;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const TriplePrestige: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default TriplePrestige;
@@ -0,0 +1,40 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { defaultAngles } from "./Hamburger";
26
+ var TriplePrestige = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = defaultAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ middle: { transform: "scale(0)" },
35
+ bottom: { transform: bottomTransform },
36
+ };
37
+ }, [direction]);
38
+ return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
39
+ };
40
+ export default TriplePrestige;
@@ -0,0 +1,3 @@
1
+ import { type Props } from "./Hamburger";
2
+ declare const TripleSpin: (props: Props) => import("react/jsx-runtime").JSX.Element;
3
+ export default TripleSpin;
@@ -0,0 +1,41 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { useMemo } from "react";
25
+ import Hamburger, { defaultAngles } from "./Hamburger";
26
+ var TripleSpin = function (props) {
27
+ var _a = props.direction, direction = _a === void 0 ? "left" : _a, rest = __rest(props, ["direction"]);
28
+ var openStyle = useMemo(function () {
29
+ var topAngle = defaultAngles[direction];
30
+ var topTransform = "rotate(".concat(topAngle, "deg)");
31
+ var bottomTransform = "rotate(".concat(-topAngle, "deg)");
32
+ return {
33
+ top: { transform: topTransform },
34
+ middle: { opacity: 0 },
35
+ bottom: { transform: bottomTransform },
36
+ outer: { transform: "rotate(180deg)" },
37
+ };
38
+ }, [direction]);
39
+ return _jsx(Hamburger, __assign({}, rest, { openStyle: openStyle }));
40
+ };
41
+ export default TripleSpin;
@@ -0,0 +1,9 @@
1
+ import TriplePrestige from "./TriplePrestige";
2
+ export { TriplePrestige };
3
+ export default TriplePrestige;
4
+ export { default as DoubleCross } from "./DoubleCross";
5
+ export { default as DoubleFlip } from "./DoubleFlip";
6
+ export { default as DoubleSpin } from "./DoubleSpin";
7
+ export { default as TripleFade } from "./TripleFade";
8
+ export { default as TripleFlip } from "./TripleFlip";
9
+ export { default as TripleSpin } from "./TripleSpin";
@@ -0,0 +1,9 @@
1
+ import TriplePrestige from "./TriplePrestige";
2
+ export { TriplePrestige };
3
+ export default TriplePrestige;
4
+ export { default as DoubleCross } from "./DoubleCross";
5
+ export { default as DoubleFlip } from "./DoubleFlip";
6
+ export { default as DoubleSpin } from "./DoubleSpin";
7
+ export { default as TripleFade } from "./TripleFade";
8
+ export { default as TripleFlip } from "./TripleFlip";
9
+ export { default as TripleSpin } from "./TripleSpin";
package/hooks/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as useScrollLock } from "./useScrollLock";
2
2
  export { default as useMediaQuery } from "./useMediaQuery";
3
- export { default as useWatchScroll } from "./useWatchScroll";
3
+ export { default as useScroll } from "./useScroll";
4
4
  export { default as useFocusTrap } from "./useFocusTrap";
5
5
  export { default as useScrollToHash } from "./useScrollToHash";
6
6
  export { default as useWindowResize } from "./useWindowResize";
package/hooks/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { default as useScrollLock } from "./useScrollLock";
2
2
  export { default as useMediaQuery } from "./useMediaQuery";
3
- export { default as useWatchScroll } from "./useWatchScroll";
3
+ export { default as useScroll } from "./useScroll";
4
4
  export { default as useFocusTrap } from "./useFocusTrap";
5
5
  export { default as useScrollToHash } from "./useScrollToHash";
6
6
  export { default as useWindowResize } from "./useWindowResize";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * A hook getting the current scroll position of the window.
3
+ * @returns an object containing the current scroll position of the window.
4
+ */
5
+ declare const useScroll: () => {
6
+ scrollX: number;
7
+ scrollY: number;
8
+ };
9
+ export default useScroll;
@@ -0,0 +1,23 @@
1
+ import { useEffect, useState } from "react";
2
+ /**
3
+ * A hook getting the current scroll position of the window.
4
+ * @returns an object containing the current scroll position of the window.
5
+ */
6
+ var useScroll = function () {
7
+ var _a = useState({
8
+ scrollX: window.scrollX,
9
+ scrollY: window.scrollY,
10
+ }), scroll = _a[0], setScroll = _a[1];
11
+ useEffect(function () {
12
+ var onScroll = function () {
13
+ setScroll({
14
+ scrollX: window.scrollX,
15
+ scrollY: window.scrollY,
16
+ });
17
+ };
18
+ window.addEventListener("scroll", onScroll);
19
+ return function () { return window.removeEventListener("scroll", onScroll); };
20
+ }, []);
21
+ return scroll;
22
+ };
23
+ export default useScroll;
package/index.d.ts CHANGED
@@ -8,6 +8,8 @@ export { default as Alert } from "./components/Alert";
8
8
  export { default as Animated } from "./components/Animated";
9
9
  export { default as Badge } from "./components/Badge";
10
10
  export { default as Banner } from "./components/Banner";
11
+ export * from "./components/Hamburger";
12
+ export { default as Hamburger } from "./components/Hamburger";
11
13
  export { default as Select } from "./components/Select";
12
14
  export { default as ClickOutside } from "./components/ClickOutside";
13
15
  export { default as Layer } from "./components/Layer";
package/index.js CHANGED
@@ -9,6 +9,8 @@ export { default as Alert } from "./components/Alert";
9
9
  export { default as Animated } from "./components/Animated";
10
10
  export { default as Badge } from "./components/Badge";
11
11
  export { default as Banner } from "./components/Banner";
12
+ export * from "./components/Hamburger";
13
+ export { default as Hamburger } from "./components/Hamburger";
12
14
  export { default as Select } from "./components/Select";
13
15
  export { default as ClickOutside } from "./components/ClickOutside";
14
16
  export { default as Layer } from "./components/Layer";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adamjanicki/ui",
3
- "version": "1.4.1",
3
+ "version": "1.4.3",
4
4
  "description": "Basic UI components and hooks for React in TypeScript",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,7 +0,0 @@
1
- /**
2
- * A hook for watching the window scroll.
3
- *
4
- * @param onScroll the callback for when the window is scrolled
5
- */
6
- declare const useWatchScroll: (onScroll: () => void) => void;
7
- export default useWatchScroll;
@@ -1,13 +0,0 @@
1
- import { useEffect } from "react";
2
- /**
3
- * A hook for watching the window scroll.
4
- *
5
- * @param onScroll the callback for when the window is scrolled
6
- */
7
- var useWatchScroll = function (onScroll) {
8
- useEffect(function () {
9
- window.addEventListener("scroll", onScroll);
10
- return function () { return window.removeEventListener("scroll", onScroll); };
11
- }, [onScroll]);
12
- };
13
- export default useWatchScroll;