@adam-milo/ui 1.0.23 → 1.0.24
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 +18 -9
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +53 -59
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +50 -104
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +108 -76
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +77 -26
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +22 -462
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +466 -109
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +111 -30
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +42 -12
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +14 -0
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -1
- package/dist/index20.js +20 -299
- package/dist/index21.cjs +1 -1
- package/dist/index21.js +298 -13
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +16 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +1193 -0
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +7 -19
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +21 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +6 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +11 -0
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +70 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +39 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +64 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +10 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +212 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +29 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +208 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +14 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +293 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +18 -0
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +43 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +89 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +14 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +71 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +6 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +14 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +34 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +122 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +11 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +17 -0
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -0
- package/dist/index60.js +297 -0
- package/dist/index61.cjs +1 -0
- package/dist/index61.js +25 -0
- package/dist/index62.cjs +1 -0
- package/dist/index62.js +39 -0
- package/dist/index63.cjs +1 -0
- package/dist/index63.js +625 -0
- package/dist/index64.cjs +1 -0
- package/dist/index64.js +39 -0
- package/dist/index65.cjs +1 -0
- package/dist/index65.js +38 -0
- package/dist/index66.cjs +1 -0
- package/dist/index66.js +7 -0
- package/dist/index67.cjs +1 -0
- package/dist/index67.js +10 -0
- package/dist/index68.cjs +1 -0
- package/dist/index68.js +5 -0
- package/dist/index69.cjs +1 -0
- package/dist/index69.js +35 -0
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -0
- package/dist/index70.js +180 -0
- package/dist/index71.cjs +1 -0
- package/dist/index71.js +21 -0
- package/dist/index72.cjs +1 -0
- package/dist/index72.js +721 -0
- package/dist/index73.cjs +1 -0
- package/dist/index73.js +154 -0
- package/dist/index74.cjs +1 -0
- package/dist/index74.js +173 -0
- package/dist/index75.cjs +1 -0
- package/dist/index75.js +88 -0
- package/dist/index76.cjs +1 -0
- package/dist/index76.js +47 -0
- package/dist/index77.cjs +1 -0
- package/dist/index77.js +13 -0
- package/dist/index78.cjs +1 -0
- package/dist/index78.js +19 -0
- package/dist/index79.cjs +1 -0
- package/dist/index79.js +102 -0
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -0
- package/dist/index80.js +11 -0
- package/dist/index81.cjs +1 -0
- package/dist/index81.js +29 -0
- package/dist/index82.cjs +1 -0
- package/dist/index82.js +16 -0
- package/dist/index83.cjs +1 -0
- package/dist/index83.js +48 -0
- package/dist/index84.cjs +1 -0
- package/dist/index84.js +9 -0
- package/dist/index85.cjs +1 -0
- package/dist/index85.js +37 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +224 -35
- package/dist/src/components/forms/select/Select.component.d.ts +100 -0
- package/dist/src/components/forms/select/Select.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/index19.cjs +0 -1
- package/dist/index19.js +0 -22
- package/dist/index30.cjs +0 -1
- package/dist/index30.js +0 -9
package/dist/index51.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { composeRefs } from "./index41.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
// @__NO_SIDE_EFFECTS__
|
|
5
|
+
function createSlot(ownerName) {
|
|
6
|
+
const SlotClone = /* @__PURE__ */ createSlotClone(ownerName);
|
|
7
|
+
const Slot2 = React.forwardRef((props, forwardedRef) => {
|
|
8
|
+
const { children, ...slotProps } = props;
|
|
9
|
+
const childrenArray = React.Children.toArray(children);
|
|
10
|
+
const slottable = childrenArray.find(isSlottable);
|
|
11
|
+
if (slottable) {
|
|
12
|
+
const newElement = slottable.props.children;
|
|
13
|
+
const newChildren = childrenArray.map((child) => {
|
|
14
|
+
if (child === slottable) {
|
|
15
|
+
if (React.Children.count(newElement) > 1) return React.Children.only(null);
|
|
16
|
+
return React.isValidElement(newElement) ? newElement.props.children : null;
|
|
17
|
+
} else {
|
|
18
|
+
return child;
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children: React.isValidElement(newElement) ? React.cloneElement(newElement, void 0, newChildren) : null });
|
|
22
|
+
}
|
|
23
|
+
return /* @__PURE__ */ jsx(SlotClone, { ...slotProps, ref: forwardedRef, children });
|
|
24
|
+
});
|
|
25
|
+
Slot2.displayName = `${ownerName}.Slot`;
|
|
26
|
+
return Slot2;
|
|
27
|
+
}
|
|
28
|
+
// @__NO_SIDE_EFFECTS__
|
|
29
|
+
function createSlotClone(ownerName) {
|
|
30
|
+
const SlotClone = React.forwardRef((props, forwardedRef) => {
|
|
31
|
+
const { children, ...slotProps } = props;
|
|
32
|
+
if (React.isValidElement(children)) {
|
|
33
|
+
const childrenRef = getElementRef(children);
|
|
34
|
+
const props2 = mergeProps(slotProps, children.props);
|
|
35
|
+
if (children.type !== React.Fragment) {
|
|
36
|
+
props2.ref = forwardedRef ? composeRefs(forwardedRef, childrenRef) : childrenRef;
|
|
37
|
+
}
|
|
38
|
+
return React.cloneElement(children, props2);
|
|
39
|
+
}
|
|
40
|
+
return React.Children.count(children) > 1 ? React.Children.only(null) : null;
|
|
41
|
+
});
|
|
42
|
+
SlotClone.displayName = `${ownerName}.SlotClone`;
|
|
43
|
+
return SlotClone;
|
|
44
|
+
}
|
|
45
|
+
var SLOTTABLE_IDENTIFIER = Symbol("radix.slottable");
|
|
46
|
+
function isSlottable(child) {
|
|
47
|
+
return React.isValidElement(child) && typeof child.type === "function" && "__radixId" in child.type && child.type.__radixId === SLOTTABLE_IDENTIFIER;
|
|
48
|
+
}
|
|
49
|
+
function mergeProps(slotProps, childProps) {
|
|
50
|
+
const overrideProps = { ...childProps };
|
|
51
|
+
for (const propName in childProps) {
|
|
52
|
+
const slotPropValue = slotProps[propName];
|
|
53
|
+
const childPropValue = childProps[propName];
|
|
54
|
+
const isHandler = /^on[A-Z]/.test(propName);
|
|
55
|
+
if (isHandler) {
|
|
56
|
+
if (slotPropValue && childPropValue) {
|
|
57
|
+
overrideProps[propName] = (...args) => {
|
|
58
|
+
const result = childPropValue(...args);
|
|
59
|
+
slotPropValue(...args);
|
|
60
|
+
return result;
|
|
61
|
+
};
|
|
62
|
+
} else if (slotPropValue) {
|
|
63
|
+
overrideProps[propName] = slotPropValue;
|
|
64
|
+
}
|
|
65
|
+
} else if (propName === "style") {
|
|
66
|
+
overrideProps[propName] = { ...slotPropValue, ...childPropValue };
|
|
67
|
+
} else if (propName === "className") {
|
|
68
|
+
overrideProps[propName] = [slotPropValue, childPropValue].filter(Boolean).join(" ");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return { ...slotProps, ...overrideProps };
|
|
72
|
+
}
|
|
73
|
+
function getElementRef(element) {
|
|
74
|
+
var _a, _b;
|
|
75
|
+
let getter = (_a = Object.getOwnPropertyDescriptor(element.props, "ref")) == null ? void 0 : _a.get;
|
|
76
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
77
|
+
if (mayWarn) {
|
|
78
|
+
return element.ref;
|
|
79
|
+
}
|
|
80
|
+
getter = (_b = Object.getOwnPropertyDescriptor(element, "ref")) == null ? void 0 : _b.get;
|
|
81
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
82
|
+
if (mayWarn) {
|
|
83
|
+
return element.props.ref;
|
|
84
|
+
}
|
|
85
|
+
return element.props.ref || element.ref;
|
|
86
|
+
}
|
|
87
|
+
export {
|
|
88
|
+
createSlot
|
|
89
|
+
};
|
package/dist/index52.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(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 t=e(require("react"));exports.useCallbackRef=function(e){const r=t.useRef(e);return t.useEffect(()=>{r.current=e}),t.useMemo(()=>(...e)=>{var t;return null==(t=r.current)?void 0:t.call(r,...e)},[])};
|
package/dist/index52.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function useCallbackRef(callback) {
|
|
3
|
+
const callbackRef = React.useRef(callback);
|
|
4
|
+
React.useEffect(() => {
|
|
5
|
+
callbackRef.current = callback;
|
|
6
|
+
});
|
|
7
|
+
return React.useMemo(() => (...args) => {
|
|
8
|
+
var _a;
|
|
9
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
10
|
+
}, []);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
useCallbackRef
|
|
14
|
+
};
|
package/dist/index53.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index54.cjs");function r(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 n=r(e);var o=n[" useInsertionEffect ".trim().toString()]||t.useLayoutEffect;exports.useControllableState=function({prop:e,defaultProp:t,onChange:r=()=>{},caller:u}){const[c,f,l]=function({defaultProp:e,onChange:t}){const[r,u]=n.useState(e),c=n.useRef(r),f=n.useRef(t);return o(()=>{f.current=t},[t]),n.useEffect(()=>{var e;c.current!==r&&(null==(e=f.current)||e.call(f,r),c.current=r)},[r,c]),[r,u,f]}({defaultProp:t,onChange:r}),s=void 0!==e,a=s?e:c;{const t=n.useRef(void 0!==e);n.useEffect(()=>{const e=t.current;if(e!==s){}t.current=s},[s,u])}const i=n.useCallback(t=>{var r;if(s){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=l.current)||r.call(l,n))}else f(t)},[s,e,f,l]);return[a,i]};
|
package/dist/index53.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useLayoutEffect as useLayoutEffect2 } from "./index54.js";
|
|
3
|
+
var useInsertionEffect = React[" useInsertionEffect ".trim().toString()] || useLayoutEffect2;
|
|
4
|
+
function useControllableState({
|
|
5
|
+
prop,
|
|
6
|
+
defaultProp,
|
|
7
|
+
onChange = () => {
|
|
8
|
+
},
|
|
9
|
+
caller
|
|
10
|
+
}) {
|
|
11
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState({
|
|
12
|
+
defaultProp,
|
|
13
|
+
onChange
|
|
14
|
+
});
|
|
15
|
+
const isControlled = prop !== void 0;
|
|
16
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
17
|
+
{
|
|
18
|
+
const isControlledRef = React.useRef(prop !== void 0);
|
|
19
|
+
React.useEffect(() => {
|
|
20
|
+
const wasControlled = isControlledRef.current;
|
|
21
|
+
if (wasControlled !== isControlled) {
|
|
22
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
23
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
24
|
+
console.warn(
|
|
25
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
isControlledRef.current = isControlled;
|
|
29
|
+
}, [isControlled, caller]);
|
|
30
|
+
}
|
|
31
|
+
const setValue = React.useCallback(
|
|
32
|
+
(nextValue) => {
|
|
33
|
+
var _a;
|
|
34
|
+
if (isControlled) {
|
|
35
|
+
const value2 = isFunction(nextValue) ? nextValue(prop) : nextValue;
|
|
36
|
+
if (value2 !== prop) {
|
|
37
|
+
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value2);
|
|
38
|
+
}
|
|
39
|
+
} else {
|
|
40
|
+
setUncontrolledProp(nextValue);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
44
|
+
);
|
|
45
|
+
return [value, setValue];
|
|
46
|
+
}
|
|
47
|
+
function useUncontrolledState({
|
|
48
|
+
defaultProp,
|
|
49
|
+
onChange
|
|
50
|
+
}) {
|
|
51
|
+
const [value, setValue] = React.useState(defaultProp);
|
|
52
|
+
const prevValueRef = React.useRef(value);
|
|
53
|
+
const onChangeRef = React.useRef(onChange);
|
|
54
|
+
useInsertionEffect(() => {
|
|
55
|
+
onChangeRef.current = onChange;
|
|
56
|
+
}, [onChange]);
|
|
57
|
+
React.useEffect(() => {
|
|
58
|
+
var _a;
|
|
59
|
+
if (prevValueRef.current !== value) {
|
|
60
|
+
(_a = onChangeRef.current) == null ? void 0 : _a.call(onChangeRef, value);
|
|
61
|
+
prevValueRef.current = value;
|
|
62
|
+
}
|
|
63
|
+
}, [value, prevValueRef]);
|
|
64
|
+
return [value, setValue, onChangeRef];
|
|
65
|
+
}
|
|
66
|
+
function isFunction(value) {
|
|
67
|
+
return typeof value === "function";
|
|
68
|
+
}
|
|
69
|
+
export {
|
|
70
|
+
useControllableState
|
|
71
|
+
};
|
package/dist/index54.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const o in e)if("default"!==o){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}return t.default=e,Object.freeze(t)}const t=e(require("react"));var o=(null==globalThis?void 0:globalThis.document)?t.useLayoutEffect:()=>{};exports.useLayoutEffect=o;
|
package/dist/index54.js
ADDED
package/dist/index55.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const u=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,u.get?u:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const r=e(require("react"));exports.usePrevious=function(e){const t=r.useRef({value:e,previous:e});return r.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])};
|
package/dist/index55.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
function usePrevious(value) {
|
|
3
|
+
const ref = React.useRef({ value, previous: value });
|
|
4
|
+
return React.useMemo(() => {
|
|
5
|
+
if (ref.current.value !== value) {
|
|
6
|
+
ref.current.previous = ref.current.value;
|
|
7
|
+
ref.current.value = value;
|
|
8
|
+
}
|
|
9
|
+
return ref.current.previous;
|
|
10
|
+
}, [value]);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
usePrevious
|
|
14
|
+
};
|
package/dist/index56.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index50.cjs"),t=require("react/jsx-runtime");function i(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const i=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,i.get?i:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const o=i(e);var n=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),a=o.forwardRef((e,i)=>t.jsx(r.Primitive.span,{...e,ref:i,style:{...n,...e.style}}));a.displayName="VisuallyHidden",exports.VISUALLY_HIDDEN_STYLES=n,exports.VisuallyHidden=a;
|
package/dist/index56.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { Primitive } from "./index50.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var VISUALLY_HIDDEN_STYLES = Object.freeze({
|
|
5
|
+
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|
|
6
|
+
position: "absolute",
|
|
7
|
+
border: 0,
|
|
8
|
+
width: 1,
|
|
9
|
+
height: 1,
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: -1,
|
|
12
|
+
overflow: "hidden",
|
|
13
|
+
clip: "rect(0, 0, 0, 0)",
|
|
14
|
+
whiteSpace: "nowrap",
|
|
15
|
+
wordWrap: "normal"
|
|
16
|
+
});
|
|
17
|
+
var NAME = "VisuallyHidden";
|
|
18
|
+
var VisuallyHidden = React.forwardRef(
|
|
19
|
+
(props, forwardedRef) => {
|
|
20
|
+
return /* @__PURE__ */ jsx(
|
|
21
|
+
Primitive.span,
|
|
22
|
+
{
|
|
23
|
+
...props,
|
|
24
|
+
ref: forwardedRef,
|
|
25
|
+
style: { ...VISUALLY_HIDDEN_STYLES, ...props.style }
|
|
26
|
+
}
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
VisuallyHidden.displayName = NAME;
|
|
31
|
+
export {
|
|
32
|
+
VISUALLY_HIDDEN_STYLES,
|
|
33
|
+
VisuallyHidden
|
|
34
|
+
};
|
package/dist/index57.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=new WeakMap,r=new WeakMap,t={},n=0,a=function(e){return e&&(e.host||a(e.parentNode))},o=function(o,u,i,c){var s=function(e,r){return r.map(function(r){if(e.contains(r))return r;var t=a(r);return t&&e.contains(t)?t:null}).filter(function(e){return Boolean(e)})}(u,Array.isArray(o)?o:[o]);t[i]||(t[i]=new WeakMap);var f=t[i],l=[],p=new Set,d=new Set(s),y=function(e){e&&!p.has(e)&&(p.add(e),y(e.parentNode))};s.forEach(y);var h=function(t){t&&!d.has(t)&&Array.prototype.forEach.call(t.children,function(t){if(p.has(t))h(t);else try{var n=t.getAttribute(c),a=null!==n&&"false"!==n,o=(e.get(t)||0)+1,u=(f.get(t)||0)+1;e.set(t,o),f.set(t,u),l.push(t),1===o&&a&&r.set(t,!0),1===u&&t.setAttribute(i,"true"),a||t.setAttribute(c,"true")}catch(s){}})};return h(u),p.clear(),n++,function(){l.forEach(function(t){var n=e.get(t)-1,a=f.get(t)-1;e.set(t,n),f.set(t,a),n||(r.has(t)||t.removeAttribute(c),r.delete(t)),a||t.removeAttribute(i)}),--n||(e=new WeakMap,e=new WeakMap,r=new WeakMap,t={})}};exports.hideOthers=function(e,r,t){void 0===t&&(t="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),o(n,a,t,"aria-hidden")):function(){return null}};
|
package/dist/index57.js
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
var getDefaultParent = function(originalTarget) {
|
|
2
|
+
if (typeof document === "undefined") {
|
|
3
|
+
return null;
|
|
4
|
+
}
|
|
5
|
+
var sampleTarget = Array.isArray(originalTarget) ? originalTarget[0] : originalTarget;
|
|
6
|
+
return sampleTarget.ownerDocument.body;
|
|
7
|
+
};
|
|
8
|
+
var counterMap = /* @__PURE__ */ new WeakMap();
|
|
9
|
+
var uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
10
|
+
var markerMap = {};
|
|
11
|
+
var lockCount = 0;
|
|
12
|
+
var unwrapHost = function(node) {
|
|
13
|
+
return node && (node.host || unwrapHost(node.parentNode));
|
|
14
|
+
};
|
|
15
|
+
var correctTargets = function(parent, targets) {
|
|
16
|
+
return targets.map(function(target) {
|
|
17
|
+
if (parent.contains(target)) {
|
|
18
|
+
return target;
|
|
19
|
+
}
|
|
20
|
+
var correctedTarget = unwrapHost(target);
|
|
21
|
+
if (correctedTarget && parent.contains(correctedTarget)) {
|
|
22
|
+
return correctedTarget;
|
|
23
|
+
}
|
|
24
|
+
console.error("aria-hidden", target, "in not contained inside", parent, ". Doing nothing");
|
|
25
|
+
return null;
|
|
26
|
+
}).filter(function(x) {
|
|
27
|
+
return Boolean(x);
|
|
28
|
+
});
|
|
29
|
+
};
|
|
30
|
+
var applyAttributeToOthers = function(originalTarget, parentNode, markerName, controlAttribute) {
|
|
31
|
+
var targets = correctTargets(parentNode, Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
32
|
+
if (!markerMap[markerName]) {
|
|
33
|
+
markerMap[markerName] = /* @__PURE__ */ new WeakMap();
|
|
34
|
+
}
|
|
35
|
+
var markerCounter = markerMap[markerName];
|
|
36
|
+
var hiddenNodes = [];
|
|
37
|
+
var elementsToKeep = /* @__PURE__ */ new Set();
|
|
38
|
+
var elementsToStop = new Set(targets);
|
|
39
|
+
var keep = function(el) {
|
|
40
|
+
if (!el || elementsToKeep.has(el)) {
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
elementsToKeep.add(el);
|
|
44
|
+
keep(el.parentNode);
|
|
45
|
+
};
|
|
46
|
+
targets.forEach(keep);
|
|
47
|
+
var deep = function(parent) {
|
|
48
|
+
if (!parent || elementsToStop.has(parent)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
Array.prototype.forEach.call(parent.children, function(node) {
|
|
52
|
+
if (elementsToKeep.has(node)) {
|
|
53
|
+
deep(node);
|
|
54
|
+
} else {
|
|
55
|
+
try {
|
|
56
|
+
var attr = node.getAttribute(controlAttribute);
|
|
57
|
+
var alreadyHidden = attr !== null && attr !== "false";
|
|
58
|
+
var counterValue = (counterMap.get(node) || 0) + 1;
|
|
59
|
+
var markerValue = (markerCounter.get(node) || 0) + 1;
|
|
60
|
+
counterMap.set(node, counterValue);
|
|
61
|
+
markerCounter.set(node, markerValue);
|
|
62
|
+
hiddenNodes.push(node);
|
|
63
|
+
if (counterValue === 1 && alreadyHidden) {
|
|
64
|
+
uncontrolledNodes.set(node, true);
|
|
65
|
+
}
|
|
66
|
+
if (markerValue === 1) {
|
|
67
|
+
node.setAttribute(markerName, "true");
|
|
68
|
+
}
|
|
69
|
+
if (!alreadyHidden) {
|
|
70
|
+
node.setAttribute(controlAttribute, "true");
|
|
71
|
+
}
|
|
72
|
+
} catch (e) {
|
|
73
|
+
console.error("aria-hidden: cannot operate on ", node, e);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
deep(parentNode);
|
|
79
|
+
elementsToKeep.clear();
|
|
80
|
+
lockCount++;
|
|
81
|
+
return function() {
|
|
82
|
+
hiddenNodes.forEach(function(node) {
|
|
83
|
+
var counterValue = counterMap.get(node) - 1;
|
|
84
|
+
var markerValue = markerCounter.get(node) - 1;
|
|
85
|
+
counterMap.set(node, counterValue);
|
|
86
|
+
markerCounter.set(node, markerValue);
|
|
87
|
+
if (!counterValue) {
|
|
88
|
+
if (!uncontrolledNodes.has(node)) {
|
|
89
|
+
node.removeAttribute(controlAttribute);
|
|
90
|
+
}
|
|
91
|
+
uncontrolledNodes.delete(node);
|
|
92
|
+
}
|
|
93
|
+
if (!markerValue) {
|
|
94
|
+
node.removeAttribute(markerName);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
lockCount--;
|
|
98
|
+
if (!lockCount) {
|
|
99
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
100
|
+
counterMap = /* @__PURE__ */ new WeakMap();
|
|
101
|
+
uncontrolledNodes = /* @__PURE__ */ new WeakMap();
|
|
102
|
+
markerMap = {};
|
|
103
|
+
}
|
|
104
|
+
};
|
|
105
|
+
};
|
|
106
|
+
var hideOthers = function(originalTarget, parentNode, markerName) {
|
|
107
|
+
if (markerName === void 0) {
|
|
108
|
+
markerName = "data-aria-hidden";
|
|
109
|
+
}
|
|
110
|
+
var targets = Array.from(Array.isArray(originalTarget) ? originalTarget : [originalTarget]);
|
|
111
|
+
var activeParentNode = getDefaultParent(originalTarget);
|
|
112
|
+
if (!activeParentNode) {
|
|
113
|
+
return function() {
|
|
114
|
+
return null;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
targets.push.apply(targets, Array.from(activeParentNode.querySelectorAll("[aria-live], script")));
|
|
118
|
+
return applyAttributeToOthers(targets, activeParentNode, markerName, "aria-hidden");
|
|
119
|
+
};
|
|
120
|
+
export {
|
|
121
|
+
hideOthers
|
|
122
|
+
};
|
package/dist/index58.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./index64.cjs"),r=require("react"),t=require("./index65.cjs"),c=require("./index66.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/index58.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { __assign } from "./index64.js";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
import { RemoveScroll } from "./index65.js";
|
|
4
|
+
import SideCar from "./index66.js";
|
|
5
|
+
var ReactRemoveScroll = React.forwardRef(function(props, ref) {
|
|
6
|
+
return React.createElement(RemoveScroll, __assign({}, props, { ref, sideCar: SideCar }));
|
|
7
|
+
});
|
|
8
|
+
ReactRemoveScroll.classNames = RemoveScroll.classNames;
|
|
9
|
+
export {
|
|
10
|
+
ReactRemoveScroll as default
|
|
11
|
+
};
|
package/dist/index59.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index52.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/index59.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import { useCallbackRef } from "./index52.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
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
useEscapeKeydown
|
|
17
|
+
};
|
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("./index21.cjs"),n=require("./index22.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 "./index21.js";
|
|
4
|
+
import { useMergedRef } from "./index22.js";
|
|
5
5
|
const AlphanumericInput = forwardRef(
|
|
6
6
|
({
|
|
7
7
|
allowHyphen = false,
|
package/dist/index60.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index63.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,_])};
|