@adam-milo/ui 1.0.24 → 1.0.25
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/dist/index.cjs +1 -1
- package/dist/index.js +3 -1
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +1 -1
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +1 -1
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +1 -1
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +1 -1
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -2
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +1 -1
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +1 -1
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +36 -12
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +14 -0
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +20 -299
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +298 -13
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +16 -0
- package/dist/{index25.cjs → index26.cjs} +1 -1
- package/dist/{index25.js → index26.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +18 -3
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +3 -67
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +6 -34
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +64 -58
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +35 -6
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +53 -201
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +6 -25
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +190 -186
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +24 -9
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +193 -278
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +11 -15
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +287 -37
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +14 -85
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +38 -9
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +80 -62
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +11 -3
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +66 -9
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +3 -31
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +12 -120
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +30 -7
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +118 -13
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +7 -293
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +14 -22
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +291 -33
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +22 -622
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +35 -35
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +620 -33
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +37 -5
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +36 -8
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +5 -3
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +8 -33
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +3 -178
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +31 -17
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +165 -706
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +16 -149
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +697 -149
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +146 -80
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +170 -44
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +44 -10
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +11 -17
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +14 -97
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +99 -8
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +82 -23
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +9 -14
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +25 -44
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +33 -5
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +12 -33
- package/dist/index86.cjs +1 -0
- package/dist/index86.js +48 -0
- package/dist/index87.cjs +1 -0
- package/dist/index87.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/layout/container/Container.component.d.ts +26 -0
- package/dist/src/components/layout/container/Container.component.d.ts.map +1 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/index20.cjs +0 -1
- package/dist/index20.js +0 -22
- package/dist/index36.cjs +0 -1
- package/dist/index36.js +0 -21
- package/dist/index39.cjs +0 -1
- package/dist/index39.js +0 -11
- /package/dist/{index33.cjs → index34.cjs} +0 -0
- /package/dist/{index33.js → index34.js} +0 -0
package/dist/index79.js
CHANGED
|
@@ -1,102 +1,19 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
var styles = window.getComputedStyle(node);
|
|
9
|
-
return (
|
|
10
|
-
// not-not-scrollable
|
|
11
|
-
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
12
|
-
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
13
|
-
);
|
|
14
|
-
};
|
|
15
|
-
var elementCouldBeVScrolled = function(node) {
|
|
16
|
-
return elementCanBeScrolled(node, "overflowY");
|
|
17
|
-
};
|
|
18
|
-
var elementCouldBeHScrolled = function(node) {
|
|
19
|
-
return elementCanBeScrolled(node, "overflowX");
|
|
20
|
-
};
|
|
21
|
-
var locationCouldBeScrolled = function(axis, node) {
|
|
22
|
-
var ownerDocument = node.ownerDocument;
|
|
23
|
-
var current = node;
|
|
24
|
-
do {
|
|
25
|
-
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
26
|
-
current = current.host;
|
|
27
|
-
}
|
|
28
|
-
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
29
|
-
if (isScrollable) {
|
|
30
|
-
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
31
|
-
if (scrollHeight > clientHeight) {
|
|
1
|
+
var passiveSupported = false;
|
|
2
|
+
if (typeof window !== "undefined") {
|
|
3
|
+
try {
|
|
4
|
+
var options = Object.defineProperty({}, "passive", {
|
|
5
|
+
get: function() {
|
|
6
|
+
passiveSupported = true;
|
|
32
7
|
return true;
|
|
33
8
|
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
var getVScrollVariables = function(_a) {
|
|
40
|
-
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
41
|
-
return [
|
|
42
|
-
scrollTop,
|
|
43
|
-
scrollHeight,
|
|
44
|
-
clientHeight
|
|
45
|
-
];
|
|
46
|
-
};
|
|
47
|
-
var getHScrollVariables = function(_a) {
|
|
48
|
-
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
49
|
-
return [
|
|
50
|
-
scrollLeft,
|
|
51
|
-
scrollWidth,
|
|
52
|
-
clientWidth
|
|
53
|
-
];
|
|
54
|
-
};
|
|
55
|
-
var elementCouldBeScrolled = function(axis, node) {
|
|
56
|
-
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
57
|
-
};
|
|
58
|
-
var getScrollVariables = function(axis, node) {
|
|
59
|
-
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
60
|
-
};
|
|
61
|
-
var getDirectionFactor = function(axis, direction) {
|
|
62
|
-
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
63
|
-
};
|
|
64
|
-
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
65
|
-
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
66
|
-
var delta = directionFactor * sourceDelta;
|
|
67
|
-
var target = event.target;
|
|
68
|
-
var targetInLock = endTarget.contains(target);
|
|
69
|
-
var shouldCancelScroll = false;
|
|
70
|
-
var isDeltaPositive = delta > 0;
|
|
71
|
-
var availableScroll = 0;
|
|
72
|
-
var availableScrollTop = 0;
|
|
73
|
-
do {
|
|
74
|
-
if (!target) {
|
|
75
|
-
break;
|
|
76
|
-
}
|
|
77
|
-
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
78
|
-
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
79
|
-
if (position || elementScroll) {
|
|
80
|
-
if (elementCouldBeScrolled(axis, target)) {
|
|
81
|
-
availableScroll += elementScroll;
|
|
82
|
-
availableScrollTop += position;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
var parent_1 = target.parentNode;
|
|
86
|
-
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
87
|
-
} while (
|
|
88
|
-
// portaled content
|
|
89
|
-
!targetInLock && target !== document.body || // self content
|
|
90
|
-
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
91
|
-
);
|
|
92
|
-
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
93
|
-
shouldCancelScroll = true;
|
|
94
|
-
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
95
|
-
shouldCancelScroll = true;
|
|
9
|
+
});
|
|
10
|
+
window.addEventListener("test", options, options);
|
|
11
|
+
window.removeEventListener("test", options, options);
|
|
12
|
+
} catch (err) {
|
|
13
|
+
passiveSupported = false;
|
|
96
14
|
}
|
|
97
|
-
|
|
98
|
-
};
|
|
15
|
+
}
|
|
16
|
+
var nonPassive = passiveSupported ? { passive: false } : false;
|
|
99
17
|
export {
|
|
100
|
-
|
|
101
|
-
locationCouldBeScrolled
|
|
18
|
+
nonPassive
|
|
102
19
|
};
|
package/dist/index8.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),r=require("react"),a=require("./index19.cjs");;/* empty css */const d=r.forwardRef(({label:d,error:i,helperText:t,className:s,id:l,required:c,disabled:o,checked:n,"data-cy":p,"data-testid":u,...b},h)=>{const x=r.useId(),y=l||x,_=`${y}-error`,m=`${y}-helper`,$=p||"radio",j=u||"radio",N=r.useRef(null),f=r.useCallback(e=>{N.current=e,h&&("function"==typeof h?h(e):"current"in h&&(h.current=e))},[h]),q=d&&c&&!d.includes("*")?`${d} *`:d;return e.jsxs("div",{className:a.cn("radio-wrapper",o&&"radio-wrapper--disabled"),"data-cy":`${$}-wrapper`,"data-testid":`${j}-wrapper`,children:[e.jsxs("div",{className:"radio__container",children:[e.jsx("input",{ref:f,id:y,type:"radio",checked:n,className:a.cn("radio__input",i&&"radio__input--error",s),"aria-describedby":i?_:t?m:void 0,"data-cy":$,"data-testid":j,disabled:o,required:c,...b}),d&&e.jsx("label",{htmlFor:y,className:"radio__label","data-cy":`${$}-label`,"data-testid":`${j}-label`,children:q})]}),i&&e.jsx("span",{id:_,className:"radio__error",role:"alert","data-cy":`${$}-error`,"data-testid":`${j}-error`,children:i}),t&&!i&&e.jsx("span",{id:m,className:"radio__helper","data-cy":`${$}-helper`,"data-testid":`${j}-helper`,children:t})]})});d.displayName="Radio",exports.Radio=d;
|
package/dist/index8.js
CHANGED
package/dist/index80.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t=function(t,e){if(!(t instanceof Element))return!1;var o=window.getComputedStyle(t);return"hidden"!==o[e]&&!(o.overflowY===o.overflowX&&!function(t){return"TEXTAREA"===t.tagName}(t)&&"visible"===o[e])},e=function(e,o){return"v"===e?function(e){return t(e,"overflowY")}(o):function(e){return t(e,"overflowX")}(o)},o=function(t,e){return"v"===t?[(o=e).scrollTop,o.scrollHeight,o.clientHeight]:function(t){return[t.scrollLeft,t.scrollWidth,t.clientWidth]}(e);var o};exports.handleScroll=function(t,n,r,i,l){var u=function(t,e){return"h"===t&&"rtl"===e?-1:1}(t,window.getComputedStyle(n).direction),a=u*i,c=r.target,d=n.contains(c),f=!1,s=a>0,v=0,h=0;do{if(!c)break;var w=o(t,c),p=w[0],b=w[1]-w[2]-u*p;(p||b)&&e(t,c)&&(v+=b,h+=p);var g=c.parentNode;c=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!d&&c!==document.body||d&&(n.contains(c)||n===c));return(s&&Math.abs(v)<1||!s&&Math.abs(h)<1)&&(f=!0),f},exports.locationCouldBeScrolled=function(t,n){var r=n.ownerDocument,i=n;do{if("undefined"!=typeof ShadowRoot&&i instanceof ShadowRoot&&(i=i.host),e(t,i)){var l=o(t,i);if(l[1]>l[2])return!0}i=i.parentNode}while(i&&i!==r.body);return!1};
|
package/dist/index80.js
CHANGED
|
@@ -1,11 +1,102 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
var alwaysContainsScroll = function(node) {
|
|
2
|
+
return node.tagName === "TEXTAREA";
|
|
3
|
+
};
|
|
4
|
+
var elementCanBeScrolled = function(node, overflow) {
|
|
5
|
+
if (!(node instanceof Element)) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
var styles = window.getComputedStyle(node);
|
|
9
|
+
return (
|
|
10
|
+
// not-not-scrollable
|
|
11
|
+
styles[overflow] !== "hidden" && // contains scroll inside self
|
|
12
|
+
!(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === "visible")
|
|
13
|
+
);
|
|
14
|
+
};
|
|
15
|
+
var elementCouldBeVScrolled = function(node) {
|
|
16
|
+
return elementCanBeScrolled(node, "overflowY");
|
|
17
|
+
};
|
|
18
|
+
var elementCouldBeHScrolled = function(node) {
|
|
19
|
+
return elementCanBeScrolled(node, "overflowX");
|
|
20
|
+
};
|
|
21
|
+
var locationCouldBeScrolled = function(axis, node) {
|
|
22
|
+
var ownerDocument = node.ownerDocument;
|
|
23
|
+
var current = node;
|
|
24
|
+
do {
|
|
25
|
+
if (typeof ShadowRoot !== "undefined" && current instanceof ShadowRoot) {
|
|
26
|
+
current = current.host;
|
|
27
|
+
}
|
|
28
|
+
var isScrollable = elementCouldBeScrolled(axis, current);
|
|
29
|
+
if (isScrollable) {
|
|
30
|
+
var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];
|
|
31
|
+
if (scrollHeight > clientHeight) {
|
|
32
|
+
return true;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
current = current.parentNode;
|
|
36
|
+
} while (current && current !== ownerDocument.body);
|
|
37
|
+
return false;
|
|
38
|
+
};
|
|
39
|
+
var getVScrollVariables = function(_a) {
|
|
40
|
+
var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;
|
|
41
|
+
return [
|
|
42
|
+
scrollTop,
|
|
43
|
+
scrollHeight,
|
|
44
|
+
clientHeight
|
|
45
|
+
];
|
|
46
|
+
};
|
|
47
|
+
var getHScrollVariables = function(_a) {
|
|
48
|
+
var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;
|
|
49
|
+
return [
|
|
50
|
+
scrollLeft,
|
|
51
|
+
scrollWidth,
|
|
52
|
+
clientWidth
|
|
53
|
+
];
|
|
54
|
+
};
|
|
55
|
+
var elementCouldBeScrolled = function(axis, node) {
|
|
56
|
+
return axis === "v" ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);
|
|
57
|
+
};
|
|
58
|
+
var getScrollVariables = function(axis, node) {
|
|
59
|
+
return axis === "v" ? getVScrollVariables(node) : getHScrollVariables(node);
|
|
60
|
+
};
|
|
61
|
+
var getDirectionFactor = function(axis, direction) {
|
|
62
|
+
return axis === "h" && direction === "rtl" ? -1 : 1;
|
|
63
|
+
};
|
|
64
|
+
var handleScroll = function(axis, endTarget, event, sourceDelta, noOverscroll) {
|
|
65
|
+
var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);
|
|
66
|
+
var delta = directionFactor * sourceDelta;
|
|
67
|
+
var target = event.target;
|
|
68
|
+
var targetInLock = endTarget.contains(target);
|
|
69
|
+
var shouldCancelScroll = false;
|
|
70
|
+
var isDeltaPositive = delta > 0;
|
|
71
|
+
var availableScroll = 0;
|
|
72
|
+
var availableScrollTop = 0;
|
|
73
|
+
do {
|
|
74
|
+
if (!target) {
|
|
75
|
+
break;
|
|
76
|
+
}
|
|
77
|
+
var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];
|
|
78
|
+
var elementScroll = scroll_1 - capacity - directionFactor * position;
|
|
79
|
+
if (position || elementScroll) {
|
|
80
|
+
if (elementCouldBeScrolled(axis, target)) {
|
|
81
|
+
availableScroll += elementScroll;
|
|
82
|
+
availableScrollTop += position;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
var parent_1 = target.parentNode;
|
|
86
|
+
target = parent_1 && parent_1.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? parent_1.host : parent_1;
|
|
87
|
+
} while (
|
|
88
|
+
// portaled content
|
|
89
|
+
!targetInLock && target !== document.body || // self content
|
|
90
|
+
targetInLock && (endTarget.contains(target) || endTarget === target)
|
|
91
|
+
);
|
|
92
|
+
if (isDeltaPositive && (Math.abs(availableScroll) < 1 || false)) {
|
|
93
|
+
shouldCancelScroll = true;
|
|
94
|
+
} else if (!isDeltaPositive && (Math.abs(availableScrollTop) < 1 || false)) {
|
|
95
|
+
shouldCancelScroll = true;
|
|
6
96
|
}
|
|
7
|
-
return
|
|
8
|
-
}
|
|
97
|
+
return shouldCancelScroll;
|
|
98
|
+
};
|
|
9
99
|
export {
|
|
10
|
-
|
|
100
|
+
handleScroll,
|
|
101
|
+
locationCouldBeScrolled
|
|
11
102
|
};
|
package/dist/index81.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index66.cjs");function r(n){return n}exports.createSidecarMedium=function(e){void 0===e&&(e={});var t=function(n,e){void 0===e&&(e=r);var t=[],u=!1;return{read:function(){if(u)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return t.length?t[t.length-1]:n},useMedium:function(n){var r=e(n,u);return t.push(r),function(){t=t.filter(function(n){return n!==r})}},assignSyncMedium:function(n){for(u=!0;t.length;){var r=t;t=[],r.forEach(n)}t={push:function(r){return n(r)},filter:function(){return t}}},assignMedium:function(n){u=!0;var r=[];if(t.length){var e=t;t=[],e.forEach(n),r=t}var i=function(){var e=r;r=[],e.forEach(n)},o=function(){return Promise.resolve().then(i)};o(),t={push:function(n){r.push(n),o()},filter:function(n){return r=r.filter(n),t}}}}}(null);return t.options=n.__assign({async:!0,ssr:!1},e),t};
|
package/dist/index81.js
CHANGED
|
@@ -1,29 +1,88 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { __assign } from "./index66.js";
|
|
2
|
+
function ItoI(a) {
|
|
3
|
+
return a;
|
|
4
|
+
}
|
|
5
|
+
function innerCreateMedium(defaults, middleware) {
|
|
6
|
+
if (middleware === void 0) {
|
|
7
|
+
middleware = ItoI;
|
|
8
|
+
}
|
|
9
|
+
var buffer = [];
|
|
10
|
+
var assigned = false;
|
|
11
|
+
var medium = {
|
|
12
|
+
read: function() {
|
|
13
|
+
if (assigned) {
|
|
14
|
+
throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");
|
|
15
|
+
}
|
|
16
|
+
if (buffer.length) {
|
|
17
|
+
return buffer[buffer.length - 1];
|
|
18
|
+
}
|
|
19
|
+
return defaults;
|
|
20
|
+
},
|
|
21
|
+
useMedium: function(data) {
|
|
22
|
+
var item = middleware(data, assigned);
|
|
23
|
+
buffer.push(item);
|
|
24
|
+
return function() {
|
|
25
|
+
buffer = buffer.filter(function(x) {
|
|
26
|
+
return x !== item;
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
assignSyncMedium: function(cb) {
|
|
31
|
+
assigned = true;
|
|
32
|
+
while (buffer.length) {
|
|
33
|
+
var cbs = buffer;
|
|
34
|
+
buffer = [];
|
|
35
|
+
cbs.forEach(cb);
|
|
36
|
+
}
|
|
37
|
+
buffer = {
|
|
38
|
+
push: function(x) {
|
|
39
|
+
return cb(x);
|
|
13
40
|
},
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (last !== value) {
|
|
17
|
-
ref.value = value;
|
|
18
|
-
ref.callback(value, last);
|
|
19
|
-
}
|
|
41
|
+
filter: function() {
|
|
42
|
+
return buffer;
|
|
20
43
|
}
|
|
44
|
+
};
|
|
45
|
+
},
|
|
46
|
+
assignMedium: function(cb) {
|
|
47
|
+
assigned = true;
|
|
48
|
+
var pendingQueue = [];
|
|
49
|
+
if (buffer.length) {
|
|
50
|
+
var cbs = buffer;
|
|
51
|
+
buffer = [];
|
|
52
|
+
cbs.forEach(cb);
|
|
53
|
+
pendingQueue = buffer;
|
|
21
54
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
var executeQueue = function() {
|
|
56
|
+
var cbs2 = pendingQueue;
|
|
57
|
+
pendingQueue = [];
|
|
58
|
+
cbs2.forEach(cb);
|
|
59
|
+
};
|
|
60
|
+
var cycle = function() {
|
|
61
|
+
return Promise.resolve().then(executeQueue);
|
|
62
|
+
};
|
|
63
|
+
cycle();
|
|
64
|
+
buffer = {
|
|
65
|
+
push: function(x) {
|
|
66
|
+
pendingQueue.push(x);
|
|
67
|
+
cycle();
|
|
68
|
+
},
|
|
69
|
+
filter: function(filter) {
|
|
70
|
+
pendingQueue = pendingQueue.filter(filter);
|
|
71
|
+
return buffer;
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return medium;
|
|
77
|
+
}
|
|
78
|
+
function createSidecarMedium(options) {
|
|
79
|
+
if (options === void 0) {
|
|
80
|
+
options = {};
|
|
81
|
+
}
|
|
82
|
+
var medium = innerCreateMedium(null);
|
|
83
|
+
medium.options = __assign({ async: true, ssr: false }, options);
|
|
84
|
+
return medium;
|
|
26
85
|
}
|
|
27
86
|
export {
|
|
28
|
-
|
|
87
|
+
createSidecarMedium
|
|
29
88
|
};
|
package/dist/index82.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"}),exports.assignRef=function(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e};
|
package/dist/index82.js
CHANGED
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
sheet.remove();
|
|
10
|
-
};
|
|
11
|
-
}, [styles && isDynamic]);
|
|
12
|
-
};
|
|
13
|
-
};
|
|
1
|
+
function assignRef(ref, value) {
|
|
2
|
+
if (typeof ref === "function") {
|
|
3
|
+
ref(value);
|
|
4
|
+
} else if (ref) {
|
|
5
|
+
ref.current = value;
|
|
6
|
+
}
|
|
7
|
+
return ref;
|
|
8
|
+
}
|
|
14
9
|
export {
|
|
15
|
-
|
|
10
|
+
assignRef
|
|
16
11
|
};
|
package/dist/index83.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react");exports.useCallbackRef=function(a,r){var t=e.useState(function(){return{value:a,callback:r,facade:{get current(){return t.value},set current(e){var a=t.value;a!==e&&(t.value=e,t.callback(e,a))}}}})[0];return t.callback=r,t.facade};
|
package/dist/index83.js
CHANGED
|
@@ -1,48 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
return
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
function insertStyleTag(tag) {
|
|
21
|
-
var head = document.head || document.getElementsByTagName("head")[0];
|
|
22
|
-
head.appendChild(tag);
|
|
23
|
-
}
|
|
24
|
-
var stylesheetSingleton = function() {
|
|
25
|
-
var counter = 0;
|
|
26
|
-
var stylesheet = null;
|
|
27
|
-
return {
|
|
28
|
-
add: function(style) {
|
|
29
|
-
if (counter == 0) {
|
|
30
|
-
if (stylesheet = makeStyleTag()) {
|
|
31
|
-
injectStyles(stylesheet, style);
|
|
32
|
-
insertStyleTag(stylesheet);
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
function useCallbackRef(initialValue, callback) {
|
|
3
|
+
var ref = useState(function() {
|
|
4
|
+
return {
|
|
5
|
+
// value
|
|
6
|
+
value: initialValue,
|
|
7
|
+
// last callback
|
|
8
|
+
callback,
|
|
9
|
+
// "memoized" public interface
|
|
10
|
+
facade: {
|
|
11
|
+
get current() {
|
|
12
|
+
return ref.value;
|
|
13
|
+
},
|
|
14
|
+
set current(value) {
|
|
15
|
+
var last = ref.value;
|
|
16
|
+
if (last !== value) {
|
|
17
|
+
ref.value = value;
|
|
18
|
+
ref.callback(value, last);
|
|
19
|
+
}
|
|
33
20
|
}
|
|
34
21
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
41
|
-
stylesheet = null;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
};
|
|
45
|
-
};
|
|
22
|
+
};
|
|
23
|
+
})[0];
|
|
24
|
+
ref.callback = callback;
|
|
25
|
+
return ref.facade;
|
|
26
|
+
}
|
|
46
27
|
export {
|
|
47
|
-
|
|
28
|
+
useCallbackRef
|
|
48
29
|
};
|
package/dist/index84.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var t={left:0,top:0,right:0,gap:0},n=function(t){return parseInt(t||"",10)||0};exports.getGapWidth=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return t;var i=function(t){var e=window.getComputedStyle(document.body),i=e["padding"===t?"paddingLeft":"marginLeft"],d=e["padding"===t?"paddingTop":"marginTop"],r=e["padding"===t?"paddingRight":"marginRight"];return[n(i),n(d),n(r)]}(e),d=document.documentElement.clientWidth,r=window.innerWidth;return{left:i[0],top:i[1],right:i[2],gap:Math.max(0,r-d+i[2]-i[0])}},exports.zeroGap=t;
|
package/dist/index84.js
CHANGED
|
@@ -1,9 +1,37 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var zeroGap = {
|
|
2
|
+
left: 0,
|
|
3
|
+
top: 0,
|
|
4
|
+
right: 0,
|
|
5
|
+
gap: 0
|
|
6
|
+
};
|
|
7
|
+
var parse = function(x) {
|
|
8
|
+
return parseInt(x || "", 10) || 0;
|
|
9
|
+
};
|
|
10
|
+
var getOffset = function(gapMode) {
|
|
11
|
+
var cs = window.getComputedStyle(document.body);
|
|
12
|
+
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
13
|
+
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
14
|
+
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
15
|
+
return [parse(left), parse(top), parse(right)];
|
|
16
|
+
};
|
|
17
|
+
var getGapWidth = function(gapMode) {
|
|
18
|
+
if (gapMode === void 0) {
|
|
19
|
+
gapMode = "margin";
|
|
20
|
+
}
|
|
21
|
+
if (typeof window === "undefined") {
|
|
22
|
+
return zeroGap;
|
|
4
23
|
}
|
|
5
|
-
|
|
24
|
+
var offsets = getOffset(gapMode);
|
|
25
|
+
var documentWidth = document.documentElement.clientWidth;
|
|
26
|
+
var windowWidth = window.innerWidth;
|
|
27
|
+
return {
|
|
28
|
+
left: offsets[0],
|
|
29
|
+
top: offsets[1],
|
|
30
|
+
right: offsets[2],
|
|
31
|
+
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
32
|
+
};
|
|
6
33
|
};
|
|
7
34
|
export {
|
|
8
|
-
|
|
35
|
+
getGapWidth,
|
|
36
|
+
zeroGap
|
|
9
37
|
};
|
package/dist/index85.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index86.cjs");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}return t.default=e,Object.freeze(t)}const r=n(e);exports.styleHookSingleton=function(){var e=t.stylesheetSingleton();return function(t,n){r.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}};
|
package/dist/index85.js
CHANGED
|
@@ -1,37 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
var left = cs[gapMode === "padding" ? "paddingLeft" : "marginLeft"];
|
|
13
|
-
var top = cs[gapMode === "padding" ? "paddingTop" : "marginTop"];
|
|
14
|
-
var right = cs[gapMode === "padding" ? "paddingRight" : "marginRight"];
|
|
15
|
-
return [parse(left), parse(top), parse(right)];
|
|
16
|
-
};
|
|
17
|
-
var getGapWidth = function(gapMode) {
|
|
18
|
-
if (gapMode === void 0) {
|
|
19
|
-
gapMode = "margin";
|
|
20
|
-
}
|
|
21
|
-
if (typeof window === "undefined") {
|
|
22
|
-
return zeroGap;
|
|
23
|
-
}
|
|
24
|
-
var offsets = getOffset(gapMode);
|
|
25
|
-
var documentWidth = document.documentElement.clientWidth;
|
|
26
|
-
var windowWidth = window.innerWidth;
|
|
27
|
-
return {
|
|
28
|
-
left: offsets[0],
|
|
29
|
-
top: offsets[1],
|
|
30
|
-
right: offsets[2],
|
|
31
|
-
gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0])
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { stylesheetSingleton } from "./index86.js";
|
|
3
|
+
var styleHookSingleton = function() {
|
|
4
|
+
var sheet = stylesheetSingleton();
|
|
5
|
+
return function(styles, isDynamic) {
|
|
6
|
+
React.useEffect(function() {
|
|
7
|
+
sheet.add(styles);
|
|
8
|
+
return function() {
|
|
9
|
+
sheet.remove();
|
|
10
|
+
};
|
|
11
|
+
}, [styles && isDynamic]);
|
|
32
12
|
};
|
|
33
13
|
};
|
|
34
14
|
export {
|
|
35
|
-
|
|
36
|
-
zeroGap
|
|
15
|
+
styleHookSingleton
|
|
37
16
|
};
|
package/dist/index86.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index87.cjs");exports.stylesheetSingleton=function(){var t=0,n=null;return{add:function(o){var r,u;0==t&&(n=function(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var n=e.getNonce();return n&&t.setAttribute("nonce",n),t}())&&(u=o,(r=n).styleSheet?r.styleSheet.cssText=u:r.appendChild(document.createTextNode(u)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(n)),t++},remove:function(){! --t&&n&&(n.parentNode&&n.parentNode.removeChild(n),n=null)}}};
|
package/dist/index86.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { getNonce } from "./index87.js";
|
|
2
|
+
function makeStyleTag() {
|
|
3
|
+
if (!document)
|
|
4
|
+
return null;
|
|
5
|
+
var tag = document.createElement("style");
|
|
6
|
+
tag.type = "text/css";
|
|
7
|
+
var nonce = getNonce();
|
|
8
|
+
if (nonce) {
|
|
9
|
+
tag.setAttribute("nonce", nonce);
|
|
10
|
+
}
|
|
11
|
+
return tag;
|
|
12
|
+
}
|
|
13
|
+
function injectStyles(tag, css) {
|
|
14
|
+
if (tag.styleSheet) {
|
|
15
|
+
tag.styleSheet.cssText = css;
|
|
16
|
+
} else {
|
|
17
|
+
tag.appendChild(document.createTextNode(css));
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function insertStyleTag(tag) {
|
|
21
|
+
var head = document.head || document.getElementsByTagName("head")[0];
|
|
22
|
+
head.appendChild(tag);
|
|
23
|
+
}
|
|
24
|
+
var stylesheetSingleton = function() {
|
|
25
|
+
var counter = 0;
|
|
26
|
+
var stylesheet = null;
|
|
27
|
+
return {
|
|
28
|
+
add: function(style) {
|
|
29
|
+
if (counter == 0) {
|
|
30
|
+
if (stylesheet = makeStyleTag()) {
|
|
31
|
+
injectStyles(stylesheet, style);
|
|
32
|
+
insertStyleTag(stylesheet);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
counter++;
|
|
36
|
+
},
|
|
37
|
+
remove: function() {
|
|
38
|
+
counter--;
|
|
39
|
+
if (!counter && stylesheet) {
|
|
40
|
+
stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);
|
|
41
|
+
stylesheet = null;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export {
|
|
47
|
+
stylesheetSingleton
|
|
48
|
+
};
|
package/dist/index87.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});exports.getNonce=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__};
|