@adam-milo/ui 1.0.28 → 1.0.29
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 +1 -1
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +43 -12
- package/dist/index2.cjs +1 -1
- package/dist/index2.js +1 -1
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +14 -0
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +20 -299
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +298 -13
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +16 -0
- package/dist/{index26.cjs → index27.cjs} +1 -1
- package/dist/{index26.js → index27.js} +21 -21
- package/dist/index3.cjs +1 -1
- package/dist/index3.js +2 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +1 -1
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +18 -3
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +3 -8
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +7 -66
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +66 -35
- package/dist/index44.cjs +1 -1
- package/dist/index44.js +31 -56
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +60 -6
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +6 -208
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +203 -20
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +23 -202
- package/dist/index49.cjs +1 -1
- package/dist/index49.js +204 -10
- package/dist/index5.cjs +1 -1
- package/dist/index5.js +1 -1
- package/dist/index50.cjs +1 -1
- package/dist/index50.js +10 -289
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +288 -13
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +14 -39
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +36 -82
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +84 -9
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +8 -65
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +68 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +3 -11
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +11 -31
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +30 -118
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +2 -2
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +120 -9
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +8 -14
- package/dist/index63.cjs +1 -1
- package/dist/index63.js +14 -22
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +291 -33
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +22 -622
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +35 -35
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +620 -33
- package/dist/index68.cjs +1 -1
- package/dist/index68.js +37 -5
- package/dist/index69.cjs +1 -1
- package/dist/index69.js +36 -8
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +1 -1
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +5 -3
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +8 -33
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +3 -178
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +31 -17
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +165 -706
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +16 -149
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +697 -149
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +150 -43
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +170 -10
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +83 -14
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +1 -1
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +41 -96
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +10 -85
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +15 -7
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +99 -26
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +8 -34
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +27 -14
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +30 -41
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +13 -6
- package/dist/index88.cjs +1 -0
- package/dist/index88.js +48 -0
- package/dist/index89.cjs +1 -0
- package/dist/index89.js +9 -0
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -2
- package/dist/src/components/typography/text/Text.component.d.ts +93 -0
- package/dist/src/components/typography/text/Text.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/index21.cjs +0 -1
- package/dist/index21.js +0 -22
- package/dist/index38.cjs +0 -1
- package/dist/index38.js +0 -21
- package/dist/index62.cjs +0 -1
- package/dist/index62.js +0 -297
- /package/dist/{index34.cjs → index35.cjs} +0 -0
- /package/dist/{index34.js → index35.js} +0 -0
package/dist/index52.js
CHANGED
|
@@ -1,43 +1,18 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import ReactDOM__default from "react-dom";
|
|
3
|
+
import { Primitive } from "./index53.js";
|
|
4
|
+
import { useLayoutEffect as useLayoutEffect2 } from "./index57.js";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"li",
|
|
16
|
-
"nav",
|
|
17
|
-
"ol",
|
|
18
|
-
"p",
|
|
19
|
-
"select",
|
|
20
|
-
"span",
|
|
21
|
-
"svg",
|
|
22
|
-
"ul"
|
|
23
|
-
];
|
|
24
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
25
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
-
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27
|
-
const { asChild, ...primitiveProps } = props;
|
|
28
|
-
const Comp = asChild ? Slot : node;
|
|
29
|
-
if (typeof window !== "undefined") {
|
|
30
|
-
window[Symbol.for("radix-ui")] = true;
|
|
31
|
-
}
|
|
32
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
33
|
-
});
|
|
34
|
-
Node.displayName = `Primitive.${node}`;
|
|
35
|
-
return { ...primitive, [node]: Node };
|
|
36
|
-
}, {});
|
|
37
|
-
function dispatchDiscreteCustomEvent(target, event) {
|
|
38
|
-
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
39
|
-
}
|
|
6
|
+
var PORTAL_NAME = "Portal";
|
|
7
|
+
var Portal = React.forwardRef((props, forwardedRef) => {
|
|
8
|
+
var _a;
|
|
9
|
+
const { container: containerProp, ...portalProps } = props;
|
|
10
|
+
const [mounted, setMounted] = React.useState(false);
|
|
11
|
+
useLayoutEffect2(() => setMounted(true), []);
|
|
12
|
+
const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
|
|
13
|
+
return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
|
|
14
|
+
});
|
|
15
|
+
Portal.displayName = PORTAL_NAME;
|
|
40
16
|
export {
|
|
41
|
-
|
|
42
|
-
dispatchDiscreteCustomEvent
|
|
17
|
+
Portal
|
|
43
18
|
};
|
package/dist/index53.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index54.cjs"),i=require("react/jsx-runtime");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=n(e),c=n(t);var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=r.createSlot(`Primitive.${t}`),c=o.forwardRef((e,r)=>{const{asChild:o,...c}=e,u=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:r})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{});exports.Primitive=u,exports.dispatchDiscreteCustomEvent=function(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))};
|
package/dist/index53.js
CHANGED
|
@@ -1,89 +1,43 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
import
|
|
2
|
+
import * as ReactDOM from "react-dom";
|
|
3
|
+
import { createSlot } from "./index54.js";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
5
|
+
var NODES = [
|
|
6
|
+
"a",
|
|
7
|
+
"button",
|
|
8
|
+
"div",
|
|
9
|
+
"form",
|
|
10
|
+
"h2",
|
|
11
|
+
"h3",
|
|
12
|
+
"img",
|
|
13
|
+
"input",
|
|
14
|
+
"label",
|
|
15
|
+
"li",
|
|
16
|
+
"nav",
|
|
17
|
+
"ol",
|
|
18
|
+
"p",
|
|
19
|
+
"select",
|
|
20
|
+
"span",
|
|
21
|
+
"svg",
|
|
22
|
+
"ul"
|
|
23
|
+
];
|
|
24
|
+
var Primitive = NODES.reduce((primitive, node) => {
|
|
25
|
+
const Slot = createSlot(`Primitive.${node}`);
|
|
26
|
+
const Node = React.forwardRef((props, forwardedRef) => {
|
|
27
|
+
const { asChild, ...primitiveProps } = props;
|
|
28
|
+
const Comp = asChild ? Slot : node;
|
|
29
|
+
if (typeof window !== "undefined") {
|
|
30
|
+
window[Symbol.for("radix-ui")] = true;
|
|
22
31
|
}
|
|
23
|
-
return /* @__PURE__ */ jsx(
|
|
32
|
+
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
24
33
|
});
|
|
25
|
-
|
|
26
|
-
return
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
|
|
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;
|
|
34
|
+
Node.displayName = `Primitive.${node}`;
|
|
35
|
+
return { ...primitive, [node]: Node };
|
|
36
|
+
}, {});
|
|
37
|
+
function dispatchDiscreteCustomEvent(target, event) {
|
|
38
|
+
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
|
86
39
|
}
|
|
87
40
|
export {
|
|
88
|
-
|
|
41
|
+
Primitive,
|
|
42
|
+
dispatchDiscreteCustomEvent
|
|
89
43
|
};
|
package/dist/index54.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"),r=require("./index44.cjs"),n=require("react/jsx-runtime");function t(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}return r.default=e,Object.freeze(r)}const o=t(e);function i(e){const n=o.forwardRef((e,n)=>{const{children:t,...i}=e;if(o.isValidElement(t)){const e=function(e){var r,n;let t=null==(r=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:r.get,o=t&&"isReactWarning"in t&&t.isReactWarning;if(o)return e.ref;if(t=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(t),l=function(e,r){const n={...r};for(const t in r){const o=e[t],i=r[t];/^on[A-Z]/.test(t)?o&&i?n[t]=(...e)=>{const r=i(...e);return o(...e),r}:o&&(n[t]=o):"style"===t?n[t]={...o,...i}:"className"===t&&(n[t]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(i,t.props);return t.type!==o.Fragment&&(l.ref=n?r.composeRefs(n,e):e),o.cloneElement(t,l)}return o.Children.count(t)>1?o.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var l=Symbol("radix.slottable");function c(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}exports.createSlot=function(e){const r=i(e),t=o.forwardRef((e,t)=>{const{children:i,...l}=e,s=o.Children.toArray(i),u=s.find(c);if(u){const e=u.props.children,i=s.map(r=>r===u?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:r);return n.jsx(r,{...l,ref:t,children:o.isValidElement(e)?o.cloneElement(e,void 0,i):null})}return n.jsx(r,{...l,ref:t,children:i})});return t.displayName=`${e}.Slot`,t};
|
package/dist/index54.js
CHANGED
|
@@ -1,14 +1,89 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import { composeRefs } from "./index44.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 });
|
|
6
24
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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;
|
|
11
86
|
}
|
|
12
87
|
export {
|
|
13
|
-
|
|
88
|
+
createSlot
|
|
14
89
|
};
|
package/dist/index55.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
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/index55.js
CHANGED
|
@@ -1,71 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
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]);
|
|
2
|
+
function useCallbackRef(callback) {
|
|
3
|
+
const callbackRef = React.useRef(callback);
|
|
57
4
|
React.useEffect(() => {
|
|
5
|
+
callbackRef.current = callback;
|
|
6
|
+
});
|
|
7
|
+
return React.useMemo(() => (...args) => {
|
|
58
8
|
var _a;
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
prevValueRef.current = value;
|
|
62
|
-
}
|
|
63
|
-
}, [value, prevValueRef]);
|
|
64
|
-
return [value, setValue, onChangeRef];
|
|
65
|
-
}
|
|
66
|
-
function isFunction(value) {
|
|
67
|
-
return typeof value === "function";
|
|
9
|
+
return (_a = callbackRef.current) == null ? void 0 : _a.call(callbackRef, ...args);
|
|
10
|
+
}, []);
|
|
68
11
|
}
|
|
69
12
|
export {
|
|
70
|
-
|
|
13
|
+
useCallbackRef
|
|
71
14
|
};
|
package/dist/index56.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("./index57.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/index56.js
CHANGED
|
@@ -1,6 +1,71 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { useLayoutEffect as useLayoutEffect2 } from "./index57.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
|
+
}
|
|
4
69
|
export {
|
|
5
|
-
|
|
70
|
+
useControllableState
|
|
6
71
|
};
|
package/dist/index57.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function e(e){const
|
|
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/index57.js
CHANGED
|
@@ -1,14 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
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
|
-
}
|
|
2
|
+
var useLayoutEffect2 = (globalThis == null ? void 0 : globalThis.document) ? React.useLayoutEffect : () => {
|
|
3
|
+
};
|
|
12
4
|
export {
|
|
13
|
-
|
|
5
|
+
useLayoutEffect2 as useLayoutEffect
|
|
14
6
|
};
|
package/dist/index58.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
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/index58.js
CHANGED
|
@@ -1,34 +1,14 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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;
|
|
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
|
+
}
|
|
31
12
|
export {
|
|
32
|
-
|
|
33
|
-
VisuallyHidden
|
|
13
|
+
usePrevious
|
|
34
14
|
};
|
package/dist/index59.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"),r=require("./index53.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;
|