Initial commit
This commit is contained in:
45
node_modules/@radix-ui/react-primitive/dist/index.mjs
generated
vendored
Normal file
45
node_modules/@radix-ui/react-primitive/dist/index.mjs
generated
vendored
Normal file
@@ -0,0 +1,45 @@
|
||||
// packages/react/primitive/src/primitive.tsx
|
||||
import * as React from "react";
|
||||
import * as ReactDOM from "react-dom";
|
||||
import { Slot } from "@radix-ui/react-slot";
|
||||
import { jsx } from "react/jsx-runtime";
|
||||
var NODES = [
|
||||
"a",
|
||||
"button",
|
||||
"div",
|
||||
"form",
|
||||
"h2",
|
||||
"h3",
|
||||
"img",
|
||||
"input",
|
||||
"label",
|
||||
"li",
|
||||
"nav",
|
||||
"ol",
|
||||
"p",
|
||||
"span",
|
||||
"svg",
|
||||
"ul"
|
||||
];
|
||||
var Primitive = NODES.reduce((primitive, node) => {
|
||||
const Node = React.forwardRef((props, forwardedRef) => {
|
||||
const { asChild, ...primitiveProps } = props;
|
||||
const Comp = asChild ? Slot : node;
|
||||
if (typeof window !== "undefined") {
|
||||
window[Symbol.for("radix-ui")] = true;
|
||||
}
|
||||
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
||||
});
|
||||
Node.displayName = `Primitive.${node}`;
|
||||
return { ...primitive, [node]: Node };
|
||||
}, {});
|
||||
function dispatchDiscreteCustomEvent(target, event) {
|
||||
if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
|
||||
}
|
||||
var Root = Primitive;
|
||||
export {
|
||||
Primitive,
|
||||
Root,
|
||||
dispatchDiscreteCustomEvent
|
||||
};
|
||||
//# sourceMappingURL=index.mjs.map
|
||||
Reference in New Issue
Block a user