Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@radix-ui/react-slot

Package Overview
Dependencies
Maintainers
5
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@radix-ui/react-slot - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

2

dist/index.d.ts

@@ -8,5 +8,5 @@ import * as React from "react";

children: React.ReactNode;
}) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, string | any | (new (props: any) => React.Component<any, any, any>)> | null) | (new (props: any) => React.Component<any, any, any>)>;
}) => React.ReactElement<any, string | ((props: any) => React.ReactElement<any, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
export const Root: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<never>>;
//# sourceMappingURL=index.d.ts.map

@@ -1,2 +0,2 @@

var e,r,t=require("@radix-ui/react-utils"),n=t.composeRefs,o=t.composeEventHandlers,c=(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);function l(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?l(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):l(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function f(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},c=Object.keys(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(e);for(n=0;n<c.length;n++)t=c[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var p=c.forwardRef((function(e,r){var t=e.children,n=f(e,["children"]);return 1===c.Children.count(t)?c.createElement(s,u({},n,{ref:r}),t):c.createElement(c.Fragment,null,c.Children.map(t,(function(e){return c.isValidElement(e)&&e.type===b?c.createElement(s,u({},n,{ref:r}),e.props.children):e})))}));exports.Slot=p,p.displayName="Slot";var s=c.forwardRef((function(e,r){var t=e.children,l=f(e,["children"]),a=c.Children.only(t);return c.isValidElement(a)?c.cloneElement(a,i(i({},function(e,r){var t=i({},r);for(var n in r){var c=e[n],l=r[n];/^on[A-Z]/.test(n)&&(t[n]="function"==typeof c&&"function"==typeof l?o(l,c):c)}return i(i({},e),t)}(l,a.props)),{},{ref:n(r,a.ref)})):null}));s.displayName="SlotClone";var b=function(e){return e.children};exports.Slottable=b;var O=p;exports.Root=O;
var e,r,t=require("@radix-ui/react-utils"),n=t.composeRefs,o=t.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);function c(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function i(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?c(Object(t),!0).forEach((function(r){a(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):c(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function a(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function u(){return(u=Object.assign||function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e}).apply(this,arguments)}function f(e,r){if(null==e)return{};var t,n,o=function(e,r){if(null==e)return{};var t,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||(o[t]=e[t]);return o}(e,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)t=l[n],r.indexOf(t)>=0||Object.prototype.propertyIsEnumerable.call(e,t)&&(o[t]=e[t])}return o}var p=l.forwardRef((function(e,r){var t=e.children,n=f(e,["children"]);return 1===l.Children.count(t)?l.createElement(s,u({},n,{ref:r}),t):l.createElement(l.Fragment,null,l.Children.map(t,(function(e){return l.isValidElement(e)&&e.type===b?l.createElement(s,u({},n,{ref:r}),e.props.children):e})))}));exports.Slot=p,p.displayName="Slot";var s=l.forwardRef((function(e,r){var t=e.children,c=f(e,["children"]),a=l.Children.only(t);return l.isValidElement(a)?l.cloneElement(a,i(i({},function(e,r){var t=i({},r);for(var n in r){var l=e[n],c=r[n];/^on[A-Z]/.test(n)&&(t[n]=o(c,l))}return i(i({},e),t)}(c,a.props)),{},{ref:n(r,a.ref)})):null}));s.displayName="SlotClone";var b=function(e){return e.children};exports.Slottable=b;var O=p;exports.Root=O;
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

import{composeRefs as e,composeEventHandlers as t}from"@radix-ui/react-utils";import*as r from"react";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function o(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c(){return(c=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}function i(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r,n,o={},l=Object.keys(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}export const Slot=r.forwardRef(((e,t)=>{const{children:n}=e,o=i(e,["children"]);return 1===r.Children.count(n)?r.createElement(f,c({},o,{ref:t}),n):r.createElement(r.Fragment,null,r.Children.map(n,(e=>r.isValidElement(e)&&e.type===Slottable?r.createElement(f,c({},o,{ref:t}),e.props.children):e)))}));Slot.displayName="Slot";const f=r.forwardRef(((n,l)=>{const{children:c}=n,f=i(n,["children"]),a=r.Children.only(c);return r.isValidElement(a)?r.cloneElement(a,o(o({},function(e,r){const n=o({},r);for(const o in r){const l=e[o],c=r[o];/^on[A-Z]/.test(o)&&(n[o]="function"==typeof l&&"function"==typeof c?t(c,l):l)}return o(o({},e),n)}(f,a.props)),{},{ref:e(l,a.ref)})):null}));f.displayName="SlotClone";export const Slottable=({children:e})=>e;export const Root=Slot;
import{composeRefs as t,composeEventHandlers as e}from"@radix-ui/react-utils";import*as r from"react";function n(){return(n=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t}).apply(this,arguments)}export const Slot=r.forwardRef(((t,e)=>{const{children:l,...a}=t;return 1===r.Children.count(l)?r.createElement(o,n({},a,{ref:e}),l):r.createElement(r.Fragment,null,r.Children.map(l,(t=>r.isValidElement(t)&&t.type===Slottable?r.createElement(o,n({},a,{ref:e}),t.props.children):t)))}));Slot.displayName="Slot";const o=r.forwardRef(((e,n)=>{const{children:o,...a}=e,c=r.Children.only(o);return r.isValidElement(c)?r.cloneElement(c,{...l(a,c.props),ref:t(n,c.ref)}):null}));o.displayName="SlotClone";export const Slottable=({children:t})=>t;function l(t,r){const n={...r};for(const o in r){const l=t[o],a=r[o];/^on[A-Z]/.test(o)&&(n[o]=e(a,l))}return{...t,...n}}export const Root=Slot;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-slot",
"version": "0.0.2",
"version": "0.0.3",
"license": "MIT",

@@ -5,0 +5,0 @@ "source": "src/index.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc