@prom-ui/core 0.1.2 → 0.3.0
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/Avatar/package.json +1 -1
- package/Backdrop/package.json +1 -1
- package/Body/package.json +1 -1
- package/BodyProvider/package.json +1 -1
- package/Box/package.json +1 -1
- package/Button/package.json +1 -1
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/package.json +1 -1
- package/Flex/package.json +1 -1
- package/Grid/package.json +1 -1
- package/Icon/package.json +1 -1
- package/Image/package.json +1 -1
- package/ImageEmoji/package.json +1 -1
- package/Input/package.json +1 -1
- package/InputField/package.json +1 -1
- package/KeyPress/cjs/index.development.js +5 -1
- package/KeyPress/cjs/index.development.v2.js +5 -1
- package/KeyPress/cjs/index.production.js +1 -1
- package/KeyPress/cjs/index.production.v2.js +1 -1
- package/KeyPress/index.d.ts +2 -0
- package/KeyPress/package.json +1 -1
- package/Line/package.json +1 -1
- package/Link/package.json +1 -1
- package/List/package.json +1 -1
- package/Media/{context.d.ts → MediaProvider.d.ts} +2 -2
- package/Media/cjs/index.development.js +16 -48
- package/Media/cjs/index.development.v2.js +16 -48
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/index.d.ts +15 -7
- package/Media/package.json +2 -2
- package/OutsideClick/cjs/index.development.js +5 -1
- package/OutsideClick/cjs/index.development.v2.js +5 -1
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +2 -1
- package/OutsideClick/package.json +1 -1
- package/Overlay/package.json +1 -1
- package/Picture/package.json +1 -1
- package/PortableOverlay/package.json +1 -1
- package/Portal/cjs/index.development.js +1 -1
- package/Portal/cjs/index.development.v2.js +1 -1
- package/Portal/cjs/index.production.js +1 -1
- package/Portal/cjs/index.production.v2.js +1 -1
- package/Portal/package.json +1 -1
- package/QRCode/package.json +1 -1
- package/Rating/package.json +1 -1
- package/SafeQuery/package.json +1 -1
- package/Scroll/package.json +1 -1
- package/ScrollControls/package.json +1 -1
- package/SideOverlay/package.json +1 -1
- package/SimpleSlider/package.json +1 -1
- package/Skeleton/package.json +1 -1
- package/Spinner/package.json +1 -1
- package/Text/package.json +1 -1
- package/TextEmoji/package.json +1 -1
- package/Tooltip/package.json +1 -1
- package/Tumbler/package.json +1 -1
- package/base/colors-dark.css +83 -37
- package/package.json +5 -4
- package/useDebounce/cjs/index.development.js +32 -0
- package/useDebounce/cjs/index.development.v2.js +32 -0
- package/useDebounce/cjs/index.production.js +1 -0
- package/useDebounce/cjs/index.production.v2.js +1 -0
- package/useDebounce/index.d.ts +4 -0
- package/useDebounce/index.js +7 -0
- package/useDebounce/index.v2.js +7 -0
- package/useDebounce/package.json +9 -0
- package/useIsMounted/cjs/index.development.js +21 -0
- package/useIsMounted/cjs/index.development.v2.js +21 -0
- package/useIsMounted/cjs/index.production.js +1 -0
- package/useIsMounted/cjs/index.production.v2.js +1 -0
- package/useIsMounted/index.d.ts +4 -0
- package/useIsMounted/index.js +7 -0
- package/useIsMounted/index.v2.js +7 -0
- package/useIsMounted/package.json +9 -0
- package/useKeyPress/cjs/index.development.js +60 -0
- package/useKeyPress/cjs/index.development.v2.js +60 -0
- package/useKeyPress/cjs/index.production.js +1 -0
- package/useKeyPress/cjs/index.production.v2.js +1 -0
- package/useKeyPress/index.d.ts +6 -0
- package/useKeyPress/index.js +7 -0
- package/useKeyPress/index.v2.js +7 -0
- package/useKeyPress/package.json +9 -0
- package/useMedia/cjs/index.development.js +27 -0
- package/useMedia/cjs/index.development.v2.js +27 -0
- package/useMedia/cjs/index.production.js +1 -0
- package/useMedia/cjs/index.production.v2.js +1 -0
- package/useMedia/index.d.ts +21 -0
- package/useMedia/index.js +7 -0
- package/useMedia/index.v2.js +7 -0
- package/useMedia/package.json +12 -0
- package/useOutsideClick/cjs/index.development.js +16 -0
- package/useOutsideClick/cjs/index.development.v2.js +16 -0
- package/useOutsideClick/cjs/index.production.js +1 -0
- package/useOutsideClick/cjs/index.production.v2.js +1 -0
- package/useOutsideClick/index.d.ts +5 -0
- package/useOutsideClick/index.js +7 -0
- package/useOutsideClick/index.v2.js +7 -0
- package/useOutsideClick/package.json +12 -0
- package/usePortal/cjs/index.development.js +85 -0
- package/usePortal/cjs/index.development.v2.js +85 -0
- package/usePortal/cjs/index.production.js +1 -0
- package/usePortal/cjs/index.production.v2.js +1 -0
- package/usePortal/index.d.ts +12 -0
- package/usePortal/index.js +7 -0
- package/usePortal/index.v2.js +7 -0
- package/usePortal/package.json +9 -0
- package/useScrollPosition/cjs/index.development.js +12 -0
- package/useScrollPosition/cjs/index.development.v2.js +12 -0
- package/useScrollPosition/cjs/index.production.js +1 -0
- package/useScrollPosition/cjs/index.production.v2.js +1 -0
- package/useScrollPosition/index.d.ts +5 -0
- package/useScrollPosition/index.js +7 -0
- package/useScrollPosition/index.v2.js +7 -0
- package/useScrollPosition/package.json +12 -0
- package/Media/breakpoints.d.ts +0 -17
- package/Media/useMedia.d.ts +0 -7
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactResponsive = require('react-responsive');
|
|
6
|
+
|
|
7
|
+
var SCREEN_BREAKPOINTS = {
|
|
8
|
+
small: 480,
|
|
9
|
+
medium: 768,
|
|
10
|
+
large: 960,
|
|
11
|
+
wide: 1200,
|
|
12
|
+
huge: 1400
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Хук позволяет определять текущее состояние медиа-запроса и обновлять его при изменении размера окна браузера.
|
|
16
|
+
*/
|
|
17
|
+
var useMedia = function (_a) {
|
|
18
|
+
var minWidth = _a.minWidth,
|
|
19
|
+
maxWidth = _a.maxWidth;
|
|
20
|
+
return reactResponsive.useMediaQuery({
|
|
21
|
+
minWidth: minWidth ? SCREEN_BREAKPOINTS[minWidth] : 1,
|
|
22
|
+
maxWidth: maxWidth ? SCREEN_BREAKPOINTS[maxWidth] - 1 : undefined
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.SCREEN_BREAKPOINTS = SCREEN_BREAKPOINTS;
|
|
27
|
+
exports.useMedia = useMedia;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var reactResponsive = require('react-responsive');
|
|
6
|
+
|
|
7
|
+
var SCREEN_BREAKPOINTS = {
|
|
8
|
+
small: 480,
|
|
9
|
+
medium: 768,
|
|
10
|
+
large: 960,
|
|
11
|
+
wide: 1200,
|
|
12
|
+
huge: 1400
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Хук позволяет определять текущее состояние медиа-запроса и обновлять его при изменении размера окна браузера.
|
|
16
|
+
*/
|
|
17
|
+
var useMedia = function (_a) {
|
|
18
|
+
var minWidth = _a.minWidth,
|
|
19
|
+
maxWidth = _a.maxWidth;
|
|
20
|
+
return reactResponsive.useMediaQuery({
|
|
21
|
+
minWidth: minWidth ? SCREEN_BREAKPOINTS[minWidth] : 1,
|
|
22
|
+
maxWidth: maxWidth ? SCREEN_BREAKPOINTS[maxWidth] - 1 : undefined
|
|
23
|
+
});
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
exports.SCREEN_BREAKPOINTS = SCREEN_BREAKPOINTS;
|
|
27
|
+
exports.useMedia = useMedia;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react-responsive"),i={small:480,medium:768,large:960,wide:1200,huge:1400};exports.SCREEN_BREAKPOINTS=i,exports.useMedia=function(r){var t=r.minWidth,d=r.maxWidth;return e.useMediaQuery({minWidth:t?i[t]:1,maxWidth:d?i[d]-1:void 0})};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react-responsive"),i={small:480,medium:768,large:960,wide:1200,huge:1400};exports.SCREEN_BREAKPOINTS=i,exports.useMedia=function(r){var t=r.minWidth,d=r.maxWidth;return e.useMediaQuery({minWidth:t?i[t]:1,maxWidth:d?i[d]-1:void 0})};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const SCREEN_BREAKPOINTS: {
|
|
2
|
+
readonly small: 480;
|
|
3
|
+
readonly medium: 768;
|
|
4
|
+
readonly large: 960;
|
|
5
|
+
readonly wide: 1200;
|
|
6
|
+
readonly huge: 1400;
|
|
7
|
+
};
|
|
8
|
+
export type useMedia = (arg: {
|
|
9
|
+
/**
|
|
10
|
+
* Аналог CSS медиа правила `@media (min-width: ...)`
|
|
11
|
+
*/
|
|
12
|
+
minWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
13
|
+
/**
|
|
14
|
+
* Аналог CSS медиа правила `@media (max-width: ...)`
|
|
15
|
+
*/
|
|
16
|
+
maxWidth?: keyof typeof SCREEN_BREAKPOINTS;
|
|
17
|
+
}) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Хук позволяет определять текущее состояние медиа-запроса и обновлять его при изменении размера окна браузера.
|
|
20
|
+
*/
|
|
21
|
+
export declare const useMedia: useMedia;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useOutsideClickRef = require('@rooks/use-outside-click-ref');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var useOutsideClickRef__default = /*#__PURE__*/_interopDefaultCompat(useOutsideClickRef);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Reack hook
|
|
13
|
+
*/
|
|
14
|
+
var useOutsideClick = useOutsideClickRef__default.default;
|
|
15
|
+
|
|
16
|
+
exports.useOutsideClick = useOutsideClick;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useOutsideClickRef = require('@rooks/use-outside-click-ref');
|
|
6
|
+
|
|
7
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
8
|
+
|
|
9
|
+
var useOutsideClickRef__default = /*#__PURE__*/_interopDefaultCompat(useOutsideClickRef);
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Reack hook
|
|
13
|
+
*/
|
|
14
|
+
var useOutsideClick = useOutsideClickRef__default.default;
|
|
15
|
+
|
|
16
|
+
exports.useOutsideClick = useOutsideClick;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@rooks/use-outside-click-ref")).default;exports.useOutsideClick=t;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("@rooks/use-outside-click-ref")).default;exports.useOutsideClick=t;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates DOM element to be used as React root.
|
|
9
|
+
* @returns {HTMLElement}
|
|
10
|
+
*/
|
|
11
|
+
function createRootElement(id) {
|
|
12
|
+
var rootContainer = document.createElement('div');
|
|
13
|
+
rootContainer.setAttribute('id', id);
|
|
14
|
+
return rootContainer;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Appends element as last child of body.
|
|
18
|
+
* @param {HTMLElement} rootElem
|
|
19
|
+
*/
|
|
20
|
+
function addRootElement(rootElem) {
|
|
21
|
+
try {
|
|
22
|
+
if (document.body.lastElementChild) {
|
|
23
|
+
document.body.insertBefore(rootElem, document.body.lastElementChild.nextElementSibling);
|
|
24
|
+
} else {
|
|
25
|
+
console.warn('Failed to add root element, document.body is empty');
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.warn('Failed to add root element');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hook to create a React Portal.
|
|
33
|
+
* Automatically handles creating and tearing-down the root elements (no SRR
|
|
34
|
+
* makes this trivial), so there is no need to ensure the parent target already
|
|
35
|
+
* exists.
|
|
36
|
+
* @example
|
|
37
|
+
* const target = usePortal(id, [id]);
|
|
38
|
+
* return createPortal(children, target);
|
|
39
|
+
* @param {String} id The id of the target container, e.g 'modal' or 'spotlight'
|
|
40
|
+
* @returns {HTMLElement} The DOM node to use as the Portal target.
|
|
41
|
+
*/
|
|
42
|
+
var usePortal = function (id) {
|
|
43
|
+
var rootElemRef = react.useRef(null);
|
|
44
|
+
react.useEffect(function () {
|
|
45
|
+
// Look for existing target dom element to append to
|
|
46
|
+
var existingParent = document.querySelector("#".concat(id));
|
|
47
|
+
// Parent is either a new root or the existing dom element
|
|
48
|
+
var parentElem = existingParent || createRootElement(id);
|
|
49
|
+
// If there is no existing DOM element, add a new one.
|
|
50
|
+
if (!existingParent) {
|
|
51
|
+
addRootElement(parentElem);
|
|
52
|
+
}
|
|
53
|
+
// Add the detached element to the parent
|
|
54
|
+
if (rootElemRef.current) {
|
|
55
|
+
parentElem.appendChild(rootElemRef.current);
|
|
56
|
+
}
|
|
57
|
+
return function () {
|
|
58
|
+
if (rootElemRef.current) {
|
|
59
|
+
rootElemRef.current.remove();
|
|
60
|
+
}
|
|
61
|
+
if (parentElem.childNodes.length === -1) {
|
|
62
|
+
parentElem.remove();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, []);
|
|
66
|
+
/**
|
|
67
|
+
* It's important we evaluate this lazily:
|
|
68
|
+
* - We need first render to contain the DOM element, so it shouldn't happen
|
|
69
|
+
* in useEffect. We would normally put this in the constructor().
|
|
70
|
+
* - We can't do 'const rootElemRef = useRef(document.createElement('div))',
|
|
71
|
+
* since this will run every single render (that's a lot).
|
|
72
|
+
* - We want the ref to consistently point to the same DOM element and only
|
|
73
|
+
* ever run once.
|
|
74
|
+
* @link https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily
|
|
75
|
+
*/
|
|
76
|
+
var getRootElem = function () {
|
|
77
|
+
if (!rootElemRef.current && typeof document !== 'undefined') {
|
|
78
|
+
rootElemRef.current = document.createElement('div');
|
|
79
|
+
}
|
|
80
|
+
return rootElemRef.current;
|
|
81
|
+
};
|
|
82
|
+
return getRootElem();
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.usePortal = usePortal;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var react = require('react');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Creates DOM element to be used as React root.
|
|
9
|
+
* @returns {HTMLElement}
|
|
10
|
+
*/
|
|
11
|
+
function createRootElement(id) {
|
|
12
|
+
var rootContainer = document.createElement('div');
|
|
13
|
+
rootContainer.setAttribute('id', id);
|
|
14
|
+
return rootContainer;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Appends element as last child of body.
|
|
18
|
+
* @param {HTMLElement} rootElem
|
|
19
|
+
*/
|
|
20
|
+
function addRootElement(rootElem) {
|
|
21
|
+
try {
|
|
22
|
+
if (document.body.lastElementChild) {
|
|
23
|
+
document.body.insertBefore(rootElem, document.body.lastElementChild.nextElementSibling);
|
|
24
|
+
} else {
|
|
25
|
+
console.warn('Failed to add root element, document.body is empty');
|
|
26
|
+
}
|
|
27
|
+
} catch (err) {
|
|
28
|
+
console.warn('Failed to add root element');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Hook to create a React Portal.
|
|
33
|
+
* Automatically handles creating and tearing-down the root elements (no SRR
|
|
34
|
+
* makes this trivial), so there is no need to ensure the parent target already
|
|
35
|
+
* exists.
|
|
36
|
+
* @example
|
|
37
|
+
* const target = usePortal(id, [id]);
|
|
38
|
+
* return createPortal(children, target);
|
|
39
|
+
* @param {String} id The id of the target container, e.g 'modal' or 'spotlight'
|
|
40
|
+
* @returns {HTMLElement} The DOM node to use as the Portal target.
|
|
41
|
+
*/
|
|
42
|
+
var usePortal = function (id) {
|
|
43
|
+
var rootElemRef = react.useRef(null);
|
|
44
|
+
react.useEffect(function () {
|
|
45
|
+
// Look for existing target dom element to append to
|
|
46
|
+
var existingParent = document.querySelector("#".concat(id));
|
|
47
|
+
// Parent is either a new root or the existing dom element
|
|
48
|
+
var parentElem = existingParent || createRootElement(id);
|
|
49
|
+
// If there is no existing DOM element, add a new one.
|
|
50
|
+
if (!existingParent) {
|
|
51
|
+
addRootElement(parentElem);
|
|
52
|
+
}
|
|
53
|
+
// Add the detached element to the parent
|
|
54
|
+
if (rootElemRef.current) {
|
|
55
|
+
parentElem.appendChild(rootElemRef.current);
|
|
56
|
+
}
|
|
57
|
+
return function () {
|
|
58
|
+
if (rootElemRef.current) {
|
|
59
|
+
rootElemRef.current.remove();
|
|
60
|
+
}
|
|
61
|
+
if (parentElem.childNodes.length === -1) {
|
|
62
|
+
parentElem.remove();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
}, []);
|
|
66
|
+
/**
|
|
67
|
+
* It's important we evaluate this lazily:
|
|
68
|
+
* - We need first render to contain the DOM element, so it shouldn't happen
|
|
69
|
+
* in useEffect. We would normally put this in the constructor().
|
|
70
|
+
* - We can't do 'const rootElemRef = useRef(document.createElement('div))',
|
|
71
|
+
* since this will run every single render (that's a lot).
|
|
72
|
+
* - We want the ref to consistently point to the same DOM element and only
|
|
73
|
+
* ever run once.
|
|
74
|
+
* @link https://reactjs.org/docs/hooks-faq.html#how-to-create-expensive-objects-lazily
|
|
75
|
+
*/
|
|
76
|
+
var getRootElem = function () {
|
|
77
|
+
if (!rootElemRef.current && typeof document !== 'undefined') {
|
|
78
|
+
rootElemRef.current = document.createElement('div');
|
|
79
|
+
}
|
|
80
|
+
return rootElemRef.current;
|
|
81
|
+
};
|
|
82
|
+
return getRootElem();
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
exports.usePortal = usePortal;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.usePortal=function(t){var n=e.useRef(null);e.useEffect((function(){var e=document.querySelector("#".concat(t)),r=e||function(e){var t=document.createElement("div");return t.setAttribute("id",e),t}(t);return e||function(e){try{document.body.lastElementChild?document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling):console.warn("Failed to add root element, document.body is empty")}catch(t){console.warn("Failed to add root element")}}(r),n.current&&r.appendChild(n.current),function(){n.current&&n.current.remove(),-1===r.childNodes.length&&r.remove()}}),[]);return n.current||"undefined"==typeof document||(n.current=document.createElement("div")),n.current};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react");exports.usePortal=function(t){var n=e.useRef(null);e.useEffect((function(){var e=document.querySelector("#".concat(t)),r=e||function(e){var t=document.createElement("div");return t.setAttribute("id",e),t}(t);return e||function(e){try{document.body.lastElementChild?document.body.insertBefore(e,document.body.lastElementChild.nextElementSibling):console.warn("Failed to add root element, document.body is empty")}catch(t){console.warn("Failed to add root element")}}(r),n.current&&r.appendChild(n.current),function(){n.current&&n.current.remove(),-1===r.childNodes.length&&r.remove()}}),[]);return n.current||"undefined"==typeof document||(n.current=document.createElement("div")),n.current};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook to create a React Portal.
|
|
3
|
+
* Automatically handles creating and tearing-down the root elements (no SRR
|
|
4
|
+
* makes this trivial), so there is no need to ensure the parent target already
|
|
5
|
+
* exists.
|
|
6
|
+
* @example
|
|
7
|
+
* const target = usePortal(id, [id]);
|
|
8
|
+
* return createPortal(children, target);
|
|
9
|
+
* @param {String} id The id of the target container, e.g 'modal' or 'spotlight'
|
|
10
|
+
* @returns {HTMLElement} The DOM node to use as the Portal target.
|
|
11
|
+
*/
|
|
12
|
+
export declare const usePortal: (id: string) => HTMLElement | null;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useScrollPosition$1 = require('@n8tb1t/use-scroll-position');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reack hook
|
|
9
|
+
*/
|
|
10
|
+
var useScrollPosition = useScrollPosition$1.useScrollPosition;
|
|
11
|
+
|
|
12
|
+
exports.useScrollPosition = useScrollPosition;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var useScrollPosition$1 = require('@n8tb1t/use-scroll-position');
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Reack hook
|
|
9
|
+
*/
|
|
10
|
+
var useScrollPosition = useScrollPosition$1.useScrollPosition;
|
|
11
|
+
|
|
12
|
+
exports.useScrollPosition = useScrollPosition;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@n8tb1t/use-scroll-position").useScrollPosition;exports.useScrollPosition=e;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@n8tb1t/use-scroll-position").useScrollPosition;exports.useScrollPosition=e;
|
package/Media/breakpoints.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare const MIN_SCREEN_WIDTH = 1;
|
|
2
|
-
export declare const SCREEN_BREAKPOINTS: {
|
|
3
|
-
small: number;
|
|
4
|
-
medium: number;
|
|
5
|
-
large: number;
|
|
6
|
-
wide: number;
|
|
7
|
-
huge: number;
|
|
8
|
-
};
|
|
9
|
-
export type tSCREEN_BREAKPOINTS = keyof typeof SCREEN_BREAKPOINTS;
|
|
10
|
-
export declare const SCREEN_BREAKPOINTS_PROXY: {
|
|
11
|
-
small: number;
|
|
12
|
-
medium: number;
|
|
13
|
-
large: number;
|
|
14
|
-
wide: number;
|
|
15
|
-
huge: number;
|
|
16
|
-
};
|
|
17
|
-
export declare const getBreakPoint: (key: tSCREEN_BREAKPOINTS) => number;
|