@radix-ui/react-slot
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,2 +0,2 @@ | ||
function e(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}var r,t=require("@radix-ui/react-compose-refs").composeRefs,n=require("@radix-ui/primitive").composeEventHandlers,o=require("react"),l=o.forwardRef,i=o.Children,c=o.createElement,s=o.Fragment,u=o.isValidElement,a=o.cloneElement,p=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r,d={};const f=l(((e,r)=>{const{children:t,...n}=e;return 1===i.count(t)?c(m,p({},n,{ref:r}),t):c(s,null,i.map(t,(e=>u(e)&&e.type===b?c(m,p({},n,{ref:r}),e.props.children):e)))}));exports.Slot=f,f.displayName="Slot";const m=l(((e,r)=>{const{children:n,...o}=e,l=i.only(n);return u(l)?a(l,{...h(o,l.props),ref:t(r,l.ref)}):null}));m.displayName="SlotClone";const b=({children:e})=>e;function h(e,r){const t={...r};for(const o in r){const l=e[o],i=r[o];/^on[A-Z]/.test(o)&&(t[o]=n(i,l))}return{...e,...t}}exports.Slottable=b;const x=f;exports.Root=x,e(d,"Root",(function(){return x})),e(d,"Slottable",(function(){return b})),e(d,"Slot",(function(){return f})); | ||
var e,r,t,n=require("@radix-ui/react-compose-refs").composeRefs,o=require("@radix-ui/primitive").composeEventHandlers,l=(e={},r=require("react"),Object.keys(r).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return r[t]}})})),e),i=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const s=l.forwardRef(((e,r)=>{const{children:t,...n}=e;return 1===l.Children.count(t)?l.createElement(c,i({},n,{ref:r}),t):l.createElement(l.Fragment,null,l.Children.map(t,(e=>l.isValidElement(e)&&e.type===a?l.createElement(c,i({},n,{ref:r}),e.props.children):e)))}));exports.Slot=s,s.displayName="Slot";const c=l.forwardRef(((e,r)=>{const{children:t,...o}=e,i=l.Children.only(t);return l.isValidElement(i)?l.cloneElement(i,{...d(o,i.props),ref:n(r,i.ref)}):null}));c.displayName="SlotClone";const a=({children:e})=>e;function d(e,r){const t={...r};for(const n in r){const l=e[n],i=r[n];/^on[A-Z]/.test(n)&&(t[n]=o(i,l))}return{...e,...t}}exports.Slottable=a;const u=s;exports.Root=u; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
function t(t,o,e){Object.defineProperty(t,o,{get:e,enumerable:!0})}import{composeRefs as o}from"@radix-ui/react-compose-refs";import{composeEventHandlers as e}from"@radix-ui/primitive";import{forwardRef as r,Children as n,createElement as l,Fragment as i,isValidElement as c,cloneElement as p}from"react";import s from"@babel/runtime/helpers/esm/extends";var u={};export const Slot=r(((t,o)=>{const{children:e,...r}=t;return 1===n.count(e)?l(a,s({},r,{ref:o}),e):l(i,null,n.map(e,(t=>c(t)&&t.type===Slottable?l(a,s({},r,{ref:o}),t.props.children):t)))}));Slot.displayName="Slot";const a=r(((t,e)=>{const{children:r,...l}=t,i=n.only(r);return c(i)?p(i,{...f(l,i.props),ref:o(e,i.ref)}):null}));a.displayName="SlotClone";export const Slottable=({children:t})=>t;function f(t,o){const r={...o};for(const n in o){const l=t[n],i=o[n];/^on[A-Z]/.test(n)&&(r[n]=e(i,l))}return{...t,...r}}export const Root=Slot;t(u,"Root",(function(){return Root})),t(u,"Slottable",(function(){return Slottable})),t(u,"Slot",(function(){return Slot})); | ||
import{composeRefs as e}from"@radix-ui/react-compose-refs";import{composeEventHandlers as t}from"@radix-ui/primitive";import*as r from"react";import o from"@babel/runtime/helpers/esm/extends";export const Slot=r.forwardRef(((e,t)=>{const{children:l,...i}=e;return 1===r.Children.count(l)?r.createElement(n,o({},i,{ref:t}),l):r.createElement(r.Fragment,null,r.Children.map(l,(e=>r.isValidElement(e)&&e.type===Slottable?r.createElement(n,o({},i,{ref:t}),e.props.children):e)))}));Slot.displayName="Slot";const n=r.forwardRef(((t,o)=>{const{children:n,...i}=t,c=r.Children.only(n);return r.isValidElement(c)?r.cloneElement(c,{...l(i,c.props),ref:e(o,c.ref)}):null}));n.displayName="SlotClone";export const Slottable=({children:e})=>e;function l(e,r){const o={...r};for(const n in r){const l=e[n],i=r[n];/^on[A-Z]/.test(n)&&(o[n]=t(i,l))}return{...e,...o}}export const Root=Slot; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-slot", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"license": "MIT", | ||
@@ -21,4 +21,4 @@ "source": "src/index.ts", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/primitive": "0.0.3", | ||
"@radix-ui/react-compose-refs": "0.0.3" | ||
"@radix-ui/primitive": "0.0.4", | ||
"@radix-ui/react-compose-refs": "0.0.4" | ||
}, | ||
@@ -25,0 +25,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21
14201
1
+ Added@radix-ui/primitive@0.0.4(transitive)
+ Added@radix-ui/react-compose-refs@0.0.4(transitive)
- Removed@radix-ui/primitive@0.0.3(transitive)
- Removed@radix-ui/react-compose-refs@0.0.3(transitive)
Updated@radix-ui/primitive@0.0.4