@adam-milo/ui 1.0.24 → 1.0.26
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 +2 -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/index6.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),t=require("react"),a=require("./index22.cjs"),n=require("./index23.cjs"),l=t.forwardRef(({allowHyphen:l=!1,allowUnderscore:r=!1,allowSpace:s=!1,minLength:u,maxLength:i,validate:c,onChange:o,"data-cy":p,"data-testid":d,...h},g)=>{const m=t.useRef(null),f=n.useMergedRef(g,m),v=t.useMemo(()=>{let e="^[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]*$",new RegExp(e)},[l,r,s]),x=t.useMemo(()=>{let e="[a-zA-Z0-9";return l&&(e+="\\-"),r&&(e+="_"),s&&(e+=" "),e+="]",new RegExp(e)},[l,r,s]),y=t.useCallback(e=>{if(e){if(!v.test(e)){let e="letters and numbers";const t=[];return l&&t.push("hyphens"),r&&t.push("underscores"),s&&t.push("spaces"),t.length>0&&(e+=`, ${t.join(", ")}`),`Only ${e} are allowed`}return void 0!==u&&e.length<u?`Must be at least ${u} characters`:void 0!==i&&e.length>i?`Must be at most ${i} characters`:void 0}},[v,u,i,l,r,s]),b=t.useCallback(e=>c?y(e)||c(e):y(e),[y,c]),[j,w]=t.useState(null);t.useEffect(()=>{null!==j&&m.current&&(m.current.setSelectionRange(j,j),w(null))},[h.value,j]);const R=t.useCallback(e=>{const t=e.target,a=t.value,n=t.selectionStart||0,l=a.split("").filter(e=>x.test(e)).join(""),r=n-a.slice(0,n).split("").filter(e=>!x.test(e)).length;t.value=l;void 0!==h.value?w(r):t.setSelectionRange(r,r),null==o||o(e)},[x,o,h.value]);return e.jsx(a.Input,{ref:f,type:"text",minLength:u,maxLength:i,validate:b,onChange:R,"data-cy":p||"alphanumeric-input","data-testid":d||"alphanumeric-input",...h})});l.displayName="AlphanumericInput",exports.AlphanumericInput=l;
|
package/dist/index6.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef, useRef, useMemo, useCallback, useState, useEffect } from "react";
|
|
3
|
-
import { Input } from "./
|
|
4
|
-
import { useMergedRef } from "./
|
|
3
|
+
import { Input } from "./index22.js";
|
|
4
|
+
import { useMergedRef } from "./index23.js";
|
|
5
5
|
const AlphanumericInput = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
allowHyphen = false,
|
package/dist/index60.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";const e=require("./index66.cjs"),r=require("react"),t=require("./index67.cjs"),c=require("./index68.cjs");function n(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const c=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,c.get?c:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const o=n(r);var s=o.forwardRef(function(r,n){return o.createElement(t.RemoveScroll,e.__assign({},r,{ref:n,sideCar:c}))});s.classNames=t.RemoveScroll.classNames,module.exports=s;
|
package/dist/index60.js
CHANGED
|
@@ -1,297 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { autoUpdate, platform } from "./index63.js";
|
|
1
|
+
import { __assign } from "./index66.js";
|
|
3
2
|
import * as React from "react";
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
var index = isClient ? useLayoutEffect : noop;
|
|
10
|
-
function deepEqual(a, b) {
|
|
11
|
-
if (a === b) {
|
|
12
|
-
return true;
|
|
13
|
-
}
|
|
14
|
-
if (typeof a !== typeof b) {
|
|
15
|
-
return false;
|
|
16
|
-
}
|
|
17
|
-
if (typeof a === "function" && a.toString() === b.toString()) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
let length;
|
|
21
|
-
let i;
|
|
22
|
-
let keys;
|
|
23
|
-
if (a && b && typeof a === "object") {
|
|
24
|
-
if (Array.isArray(a)) {
|
|
25
|
-
length = a.length;
|
|
26
|
-
if (length !== b.length) return false;
|
|
27
|
-
for (i = length; i-- !== 0; ) {
|
|
28
|
-
if (!deepEqual(a[i], b[i])) {
|
|
29
|
-
return false;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
return true;
|
|
33
|
-
}
|
|
34
|
-
keys = Object.keys(a);
|
|
35
|
-
length = keys.length;
|
|
36
|
-
if (length !== Object.keys(b).length) {
|
|
37
|
-
return false;
|
|
38
|
-
}
|
|
39
|
-
for (i = length; i-- !== 0; ) {
|
|
40
|
-
if (!{}.hasOwnProperty.call(b, keys[i])) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
for (i = length; i-- !== 0; ) {
|
|
45
|
-
const key = keys[i];
|
|
46
|
-
if (key === "_owner" && a.$$typeof) {
|
|
47
|
-
continue;
|
|
48
|
-
}
|
|
49
|
-
if (!deepEqual(a[key], b[key])) {
|
|
50
|
-
return false;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
return true;
|
|
54
|
-
}
|
|
55
|
-
return a !== a && b !== b;
|
|
56
|
-
}
|
|
57
|
-
function getDPR(element) {
|
|
58
|
-
if (typeof window === "undefined") {
|
|
59
|
-
return 1;
|
|
60
|
-
}
|
|
61
|
-
const win = element.ownerDocument.defaultView || window;
|
|
62
|
-
return win.devicePixelRatio || 1;
|
|
63
|
-
}
|
|
64
|
-
function roundByDPR(element, value) {
|
|
65
|
-
const dpr = getDPR(element);
|
|
66
|
-
return Math.round(value * dpr) / dpr;
|
|
67
|
-
}
|
|
68
|
-
function useLatestRef(value) {
|
|
69
|
-
const ref = React.useRef(value);
|
|
70
|
-
index(() => {
|
|
71
|
-
ref.current = value;
|
|
72
|
-
});
|
|
73
|
-
return ref;
|
|
74
|
-
}
|
|
75
|
-
function useFloating(options) {
|
|
76
|
-
if (options === void 0) {
|
|
77
|
-
options = {};
|
|
78
|
-
}
|
|
79
|
-
const {
|
|
80
|
-
placement = "bottom",
|
|
81
|
-
strategy = "absolute",
|
|
82
|
-
middleware = [],
|
|
83
|
-
platform: platform2,
|
|
84
|
-
elements: {
|
|
85
|
-
reference: externalReference,
|
|
86
|
-
floating: externalFloating
|
|
87
|
-
} = {},
|
|
88
|
-
transform = true,
|
|
89
|
-
whileElementsMounted,
|
|
90
|
-
open
|
|
91
|
-
} = options;
|
|
92
|
-
const [data, setData] = React.useState({
|
|
93
|
-
x: 0,
|
|
94
|
-
y: 0,
|
|
95
|
-
strategy,
|
|
96
|
-
placement,
|
|
97
|
-
middlewareData: {},
|
|
98
|
-
isPositioned: false
|
|
99
|
-
});
|
|
100
|
-
const [latestMiddleware, setLatestMiddleware] = React.useState(middleware);
|
|
101
|
-
if (!deepEqual(latestMiddleware, middleware)) {
|
|
102
|
-
setLatestMiddleware(middleware);
|
|
103
|
-
}
|
|
104
|
-
const [_reference, _setReference] = React.useState(null);
|
|
105
|
-
const [_floating, _setFloating] = React.useState(null);
|
|
106
|
-
const setReference = React.useCallback((node) => {
|
|
107
|
-
if (node !== referenceRef.current) {
|
|
108
|
-
referenceRef.current = node;
|
|
109
|
-
_setReference(node);
|
|
110
|
-
}
|
|
111
|
-
}, []);
|
|
112
|
-
const setFloating = React.useCallback((node) => {
|
|
113
|
-
if (node !== floatingRef.current) {
|
|
114
|
-
floatingRef.current = node;
|
|
115
|
-
_setFloating(node);
|
|
116
|
-
}
|
|
117
|
-
}, []);
|
|
118
|
-
const referenceEl = externalReference || _reference;
|
|
119
|
-
const floatingEl = externalFloating || _floating;
|
|
120
|
-
const referenceRef = React.useRef(null);
|
|
121
|
-
const floatingRef = React.useRef(null);
|
|
122
|
-
const dataRef = React.useRef(data);
|
|
123
|
-
const hasWhileElementsMounted = whileElementsMounted != null;
|
|
124
|
-
const whileElementsMountedRef = useLatestRef(whileElementsMounted);
|
|
125
|
-
const platformRef = useLatestRef(platform2);
|
|
126
|
-
const openRef = useLatestRef(open);
|
|
127
|
-
const update = React.useCallback(() => {
|
|
128
|
-
if (!referenceRef.current || !floatingRef.current) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
const config = {
|
|
132
|
-
placement,
|
|
133
|
-
strategy,
|
|
134
|
-
middleware: latestMiddleware
|
|
135
|
-
};
|
|
136
|
-
if (platformRef.current) {
|
|
137
|
-
config.platform = platformRef.current;
|
|
138
|
-
}
|
|
139
|
-
computePosition(referenceRef.current, floatingRef.current, config).then((data2) => {
|
|
140
|
-
const fullData = {
|
|
141
|
-
...data2,
|
|
142
|
-
// The floating element's position may be recomputed while it's closed
|
|
143
|
-
// but still mounted (such as when transitioning out). To ensure
|
|
144
|
-
// `isPositioned` will be `false` initially on the next open, avoid
|
|
145
|
-
// setting it to `true` when `open === false` (must be specified).
|
|
146
|
-
isPositioned: openRef.current !== false
|
|
147
|
-
};
|
|
148
|
-
if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) {
|
|
149
|
-
dataRef.current = fullData;
|
|
150
|
-
ReactDOM.flushSync(() => {
|
|
151
|
-
setData(fullData);
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
}, [latestMiddleware, placement, strategy, platformRef, openRef]);
|
|
156
|
-
index(() => {
|
|
157
|
-
if (open === false && dataRef.current.isPositioned) {
|
|
158
|
-
dataRef.current.isPositioned = false;
|
|
159
|
-
setData((data2) => ({
|
|
160
|
-
...data2,
|
|
161
|
-
isPositioned: false
|
|
162
|
-
}));
|
|
163
|
-
}
|
|
164
|
-
}, [open]);
|
|
165
|
-
const isMountedRef = React.useRef(false);
|
|
166
|
-
index(() => {
|
|
167
|
-
isMountedRef.current = true;
|
|
168
|
-
return () => {
|
|
169
|
-
isMountedRef.current = false;
|
|
170
|
-
};
|
|
171
|
-
}, []);
|
|
172
|
-
index(() => {
|
|
173
|
-
if (referenceEl) referenceRef.current = referenceEl;
|
|
174
|
-
if (floatingEl) floatingRef.current = floatingEl;
|
|
175
|
-
if (referenceEl && floatingEl) {
|
|
176
|
-
if (whileElementsMountedRef.current) {
|
|
177
|
-
return whileElementsMountedRef.current(referenceEl, floatingEl, update);
|
|
178
|
-
}
|
|
179
|
-
update();
|
|
180
|
-
}
|
|
181
|
-
}, [referenceEl, floatingEl, update, whileElementsMountedRef, hasWhileElementsMounted]);
|
|
182
|
-
const refs = React.useMemo(() => ({
|
|
183
|
-
reference: referenceRef,
|
|
184
|
-
floating: floatingRef,
|
|
185
|
-
setReference,
|
|
186
|
-
setFloating
|
|
187
|
-
}), [setReference, setFloating]);
|
|
188
|
-
const elements = React.useMemo(() => ({
|
|
189
|
-
reference: referenceEl,
|
|
190
|
-
floating: floatingEl
|
|
191
|
-
}), [referenceEl, floatingEl]);
|
|
192
|
-
const floatingStyles = React.useMemo(() => {
|
|
193
|
-
const initialStyles = {
|
|
194
|
-
position: strategy,
|
|
195
|
-
left: 0,
|
|
196
|
-
top: 0
|
|
197
|
-
};
|
|
198
|
-
if (!elements.floating) {
|
|
199
|
-
return initialStyles;
|
|
200
|
-
}
|
|
201
|
-
const x = roundByDPR(elements.floating, data.x);
|
|
202
|
-
const y = roundByDPR(elements.floating, data.y);
|
|
203
|
-
if (transform) {
|
|
204
|
-
return {
|
|
205
|
-
...initialStyles,
|
|
206
|
-
transform: "translate(" + x + "px, " + y + "px)",
|
|
207
|
-
...getDPR(elements.floating) >= 1.5 && {
|
|
208
|
-
willChange: "transform"
|
|
209
|
-
}
|
|
210
|
-
};
|
|
211
|
-
}
|
|
212
|
-
return {
|
|
213
|
-
position: strategy,
|
|
214
|
-
left: x,
|
|
215
|
-
top: y
|
|
216
|
-
};
|
|
217
|
-
}, [strategy, transform, elements.floating, data.x, data.y]);
|
|
218
|
-
return React.useMemo(() => ({
|
|
219
|
-
...data,
|
|
220
|
-
update,
|
|
221
|
-
refs,
|
|
222
|
-
elements,
|
|
223
|
-
floatingStyles
|
|
224
|
-
}), [data, update, refs, elements, floatingStyles]);
|
|
225
|
-
}
|
|
226
|
-
const arrow$1 = (options) => {
|
|
227
|
-
function isRef(value) {
|
|
228
|
-
return {}.hasOwnProperty.call(value, "current");
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
name: "arrow",
|
|
232
|
-
options,
|
|
233
|
-
fn(state) {
|
|
234
|
-
const {
|
|
235
|
-
element,
|
|
236
|
-
padding
|
|
237
|
-
} = typeof options === "function" ? options(state) : options;
|
|
238
|
-
if (element && isRef(element)) {
|
|
239
|
-
if (element.current != null) {
|
|
240
|
-
return arrow$2({
|
|
241
|
-
element: element.current,
|
|
242
|
-
padding
|
|
243
|
-
}).fn(state);
|
|
244
|
-
}
|
|
245
|
-
return {};
|
|
246
|
-
}
|
|
247
|
-
if (element) {
|
|
248
|
-
return arrow$2({
|
|
249
|
-
element,
|
|
250
|
-
padding
|
|
251
|
-
}).fn(state);
|
|
252
|
-
}
|
|
253
|
-
return {};
|
|
254
|
-
}
|
|
255
|
-
};
|
|
256
|
-
};
|
|
257
|
-
const offset = (options, deps) => ({
|
|
258
|
-
...offset$1(options),
|
|
259
|
-
options: [options, deps]
|
|
260
|
-
});
|
|
261
|
-
const shift = (options, deps) => ({
|
|
262
|
-
...shift$1(options),
|
|
263
|
-
options: [options, deps]
|
|
264
|
-
});
|
|
265
|
-
const limitShift = (options, deps) => ({
|
|
266
|
-
...limitShift$1(options),
|
|
267
|
-
options: [options, deps]
|
|
268
|
-
});
|
|
269
|
-
const flip = (options, deps) => ({
|
|
270
|
-
...flip$1(options),
|
|
271
|
-
options: [options, deps]
|
|
272
|
-
});
|
|
273
|
-
const size = (options, deps) => ({
|
|
274
|
-
...size$1(options),
|
|
275
|
-
options: [options, deps]
|
|
276
|
-
});
|
|
277
|
-
const hide = (options, deps) => ({
|
|
278
|
-
...hide$1(options),
|
|
279
|
-
options: [options, deps]
|
|
280
|
-
});
|
|
281
|
-
const arrow = (options, deps) => ({
|
|
282
|
-
...arrow$1(options),
|
|
283
|
-
options: [options, deps]
|
|
3
|
+
import { RemoveScroll } from "./index67.js";
|
|
4
|
+
import SideCar from "./index68.js";
|
|
5
|
+
var ReactRemoveScroll = React.forwardRef(function(props, ref) {
|
|
6
|
+
return React.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar }));
|
|
284
7
|
});
|
|
8
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
285
9
|
export {
|
|
286
|
-
|
|
287
|
-
autoUpdate,
|
|
288
|
-
computePosition,
|
|
289
|
-
flip,
|
|
290
|
-
hide,
|
|
291
|
-
limitShift,
|
|
292
|
-
offset,
|
|
293
|
-
platform,
|
|
294
|
-
shift,
|
|
295
|
-
size,
|
|
296
|
-
useFloating
|
|
10
|
+
ReactRemoveScroll as default
|
|
297
11
|
};
|
package/dist/index61.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index54.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.useEscapeKeydown=function(e,n=(null==globalThis?void 0:globalThis.document)){const o=t.useCallbackRef(e);r.useEffect(()=>{const e=e=>{"Escape"===e.key&&o(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[o,n])};
|
package/dist/index61.js
CHANGED
|
@@ -1,25 +1,17 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
preserveAspectRatio: "none",
|
|
16
|
-
children: props.asChild ? children : /* @__PURE__ */ jsx("polygon", { points: "0,0 30,0 15,10" })
|
|
17
|
-
}
|
|
18
|
-
);
|
|
19
|
-
});
|
|
20
|
-
Arrow.displayName = NAME;
|
|
21
|
-
var Root = Arrow;
|
|
2
|
+
import { useCallbackRef } from "./index54.js";
|
|
3
|
+
function useEscapeKeydown(onEscapeKeyDownProp, ownerDocument = globalThis == null ? void 0 : globalThis.document) {
|
|
4
|
+
const onEscapeKeyDown = useCallbackRef(onEscapeKeyDownProp);
|
|
5
|
+
React.useEffect(() => {
|
|
6
|
+
const handleKeyDown = (event) => {
|
|
7
|
+
if (event.key === "Escape") {
|
|
8
|
+
onEscapeKeyDown(event);
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
ownerDocument.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
12
|
+
return () => ownerDocument.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
13
|
+
}, [onEscapeKeyDown, ownerDocument]);
|
|
14
|
+
}
|
|
22
15
|
export {
|
|
23
|
-
|
|
24
|
-
Root
|
|
16
|
+
useEscapeKeydown
|
|
25
17
|
};
|
package/dist/index62.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("./index65.cjs"),t=require("react"),r=require("react-dom");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=n(t),i=n(r);var u="undefined"!=typeof document?t.useLayoutEffect:function(){};function s(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!s(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(("_owner"!==r||!e.$$typeof)&&!s(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function f(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function c(e,t){const r=f(e);return Math.round(t*r)/r}function l(e){const t=o.useRef(e);return u(()=>{t.current=e}),t}const a=t=>({name:"arrow",options:t,fn(r){const{element:n,padding:o}="function"==typeof t?t(r):t;return n&&(i=n,{}.hasOwnProperty.call(i,"current"))?null!=n.current?e.arrow({element:n.current,padding:o}).fn(r):{}:n?e.arrow({element:n,padding:o}).fn(r):{};var i}});exports.autoUpdate=e.autoUpdate,exports.computePosition=e.computePosition,exports.platform=e.platform,exports.arrow=(e,t)=>({...a(e),options:[e,t]}),exports.flip=(t,r)=>({...e.flip(t),options:[t,r]}),exports.hide=(t,r)=>({...e.hide(t),options:[t,r]}),exports.limitShift=(t,r)=>({...e.limitShift(t),options:[t,r]}),exports.offset=(t,r)=>({...e.offset(t),options:[t,r]}),exports.shift=(t,r)=>({...e.shift(t),options:[t,r]}),exports.size=(t,r)=>({...e.size(t),options:[t,r]}),exports.useFloating=function(t){void 0===t&&(t={});const{placement:r="bottom",strategy:n="absolute",middleware:a=[],platform:p,elements:{reference:d,floating:m}={},transform:g=!0,whileElementsMounted:y,open:w}=t,[x,h]=o.useState({x:0,y:0,strategy:n,placement:r,middlewareData:{},isPositioned:!1}),[b,P]=o.useState(a);s(b,a)||P(a);const[S,O]=o.useState(null),[j,M]=o.useState(null),R=o.useCallback(e=>{e!==q.current&&(q.current=e,O(e))},[]),v=o.useCallback(e=>{e!==z.current&&(z.current=e,M(e))},[]),k=d||S,C=m||j,q=o.useRef(null),z=o.useRef(null),D=o.useRef(x),A=null!=y,E=l(y),F=l(p),T=l(w),U=o.useCallback(()=>{if(!q.current||!z.current)return;const t={placement:r,strategy:n,middleware:b};F.current&&(t.platform=F.current),e.computePosition(q.current,z.current,t).then(e=>{const t={...e,isPositioned:!1!==T.current};$.current&&!s(D.current,t)&&(D.current=t,i.flushSync(()=>{h(t)}))})},[b,r,n,F,T]);u(()=>{!1===w&&D.current.isPositioned&&(D.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[w]);const $=o.useRef(!1);u(()=>($.current=!0,()=>{$.current=!1}),[]),u(()=>{if(k&&(q.current=k),C&&(z.current=C),k&&C){if(E.current)return E.current(k,C,U);U()}},[k,C,U,E,A]);const L=o.useMemo(()=>({reference:q,floating:z,setReference:R,setFloating:v}),[R,v]),V=o.useMemo(()=>({reference:k,floating:C}),[k,C]),_=o.useMemo(()=>{const e={position:n,left:0,top:0};if(!V.floating)return e;const t=c(V.floating,x.x),r=c(V.floating,x.y);return g?{...e,transform:"translate("+t+"px, "+r+"px)",...f(V.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:t,top:r}},[n,g,V.floating,x.x,x.y]);return o.useMemo(()=>({...x,update:U,refs:L,elements:V,floatingStyles:_}),[x,U,L,V,_])};
|