Socket
Socket
Sign inDemoInstall

@radix-ui/react-slot

Package Overview
Dependencies
Maintainers
8
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.1.0 to 0.1.1-rc.1

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, any> | null) | (new (props: any) => React.Component<any, any, any>)>;
}) => JSX.Element;
export const Root: React.ForwardRefExoticComponent<SlotProps & React.RefAttributes<HTMLElement>>;
//# sourceMappingURL=index.d.ts.map

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

var e,n,t,r=require("@radix-ui/react-compose-refs").composeRefs,l=(e={},n=require("react"),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const c=/*#__PURE__*/l.forwardRef(((e,n)=>{const{children:t,...r}=e;return 1===l.Children.count(t)?/*#__PURE__*/l.createElement(s,o({},r,{ref:n}),t):/*#__PURE__*/l.createElement(l.Fragment,null,l.Children.map(t,(e=>/*#__PURE__*/l.isValidElement(e)&&e.type===i?/*#__PURE__*/l.createElement(s,o({},r,{ref:n}),e.props.children):e)))}));exports.Slot=c,c.displayName="Slot";const s=/*#__PURE__*/l.forwardRef(((e,n)=>{const{children:t,...o}=e,c=l.Children.only(t);/*#__PURE__*/return l.isValidElement(c)?/*#__PURE__*/l.cloneElement(c,{...a(o,c.props),ref:r(n,c.ref)}):null}));s.displayName="SlotClone";const i=({children:e})=>e;function a(e,n){const t={...n};for(const r in n){const l=e[r],o=n[r];/^on[A-Z]/.test(r)?t[r]=u(o,l):"style"===r?t[r]={...l,...o}:"className"===r&&(t[r]=[l,o].filter(Boolean).join(" "))}return{...e,...t}}function u(e,n){return function(...t){null==e||e(...t);t[0]instanceof Event&&t[0].defaultPrevented||null==n||n(...t)}}exports.Slottable=i;const f=c;exports.Root=f;
var e,n,t,r=require("@radix-ui/react-compose-refs").composeRefs,l=(e={},n=require("react"),Object.keys(n).forEach((function(t){"default"!==t&&"__esModule"!==t&&Object.defineProperty(e,t,{enumerable:!0,get:function(){return n[t]}})})),e),o=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t;const c=/*#__PURE__*/l.forwardRef(((e,n)=>{const{children:t,...r}=e,c=l.Children.toArray(t);return c.some(i)?/*#__PURE__*/l.createElement(l.Fragment,null,c.map((e=>i(e)?/*#__PURE__*/l.createElement(s,o({},r,{ref:n}),e.props.children):e))):/*#__PURE__*/l.createElement(s,o({},r,{ref:n}),t)}));exports.Slot=c,c.displayName="Slot";const s=/*#__PURE__*/l.forwardRef(((e,n)=>{const{children:t,...o}=e;/*#__PURE__*/return l.isValidElement(t)?/*#__PURE__*/l.cloneElement(t,{...u(o,t.props),ref:r(n,t.ref)}):l.Children.count(t)>1?l.Children.only(null):null}));s.displayName="SlotClone";const a=({children:e})=>/*#__PURE__*/l.createElement(l.Fragment,null,e);function i(e){/*#__PURE__*/return l.isValidElement(e)&&e.type===a}function u(e,n){const t={...n};for(const r in n){const l=e[r],o=n[r];/^on[A-Z]/.test(r)?t[r]=f(o,l):"style"===r?t[r]={...l,...o}:"className"===r&&(t[r]=[l,o].filter(Boolean).join(" "))}return{...e,...t}}function f(e,n){return function(...t){null==e||e(...t);t[0]instanceof Event&&t[0].defaultPrevented||null==n||n(...t)}}exports.Slottable=a;const d=c;exports.Root=d;
//# sourceMappingURL=index.js.map

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

import{composeRefs as e}from"@radix-ui/react-compose-refs";import*as t from"react";import n from"@babel/runtime/helpers/esm/extends";export const Slot=/*#__PURE__*/t.forwardRef(((e,o)=>{const{children:l,...c}=e;return 1===t.Children.count(l)?/*#__PURE__*/t.createElement(r,n({},c,{ref:o}),l):/*#__PURE__*/t.createElement(t.Fragment,null,t.Children.map(l,(e=>/*#__PURE__*/t.isValidElement(e)&&e.type===Slottable?/*#__PURE__*/t.createElement(r,n({},c,{ref:o}),e.props.children):e)))}));Slot.displayName="Slot";const r=/*#__PURE__*/t.forwardRef(((n,r)=>{const{children:l,...c}=n,i=t.Children.only(l);/*#__PURE__*/return t.isValidElement(i)?/*#__PURE__*/t.cloneElement(i,{...o(c,i.props),ref:e(r,i.ref)}):null}));r.displayName="SlotClone";export const Slottable=({children:e})=>e;function o(e,t){const n={...t};for(const r in t){const o=e[r],c=t[r];/^on[A-Z]/.test(r)?n[r]=l(c,o):"style"===r?n[r]={...o,...c}:"className"===r&&(n[r]=[o,c].filter(Boolean).join(" "))}return{...e,...n}}function l(e,t){return function(...n){null==e||e(...n);n[0]instanceof Event&&n[0].defaultPrevented||null==t||t(...n)}}export const Root=Slot;
import{composeRefs as e}from"@radix-ui/react-compose-refs";import*as t from"react";import n from"@babel/runtime/helpers/esm/extends";export const Slot=/*#__PURE__*/t.forwardRef(((e,o)=>{const{children:a,...c}=e,i=t.Children.toArray(a);return i.some(l)?/*#__PURE__*/t.createElement(t.Fragment,null,i.map((e=>l(e)?/*#__PURE__*/t.createElement(r,n({},c,{ref:o}),e.props.children):e))):/*#__PURE__*/t.createElement(r,n({},c,{ref:o}),a)}));Slot.displayName="Slot";const r=/*#__PURE__*/t.forwardRef(((n,r)=>{const{children:l,...a}=n;/*#__PURE__*/return t.isValidElement(l)?/*#__PURE__*/t.cloneElement(l,{...o(a,l.props),ref:e(r,l.ref)}):t.Children.count(l)>1?t.Children.only(null):null}));r.displayName="SlotClone";export const Slottable=({children:e})=>/*#__PURE__*/t.createElement(t.Fragment,null,e);function l(e){/*#__PURE__*/return t.isValidElement(e)&&e.type===Slottable}function o(e,t){const n={...t};for(const r in t){const l=e[r],o=t[r];/^on[A-Z]/.test(r)?n[r]=a(o,l):"style"===r?n[r]={...l,...o}:"className"===r&&(n[r]=[l,o].filter(Boolean).join(" "))}return{...e,...n}}function a(e,t){return function(...n){null==e||e(...n);n[0]instanceof Event&&n[0].defaultPrevented||null==t||t(...n)}}export const Root=Slot;
//# sourceMappingURL=index.module.js.map
{
"name": "@radix-ui/react-slot",
"version": "0.1.0",
"version": "0.1.1-rc.1",
"license": "MIT",

@@ -32,3 +32,4 @@ "source": "src/index.ts",

"url": "https://github.com/radix-ui/primitives/issues"
}
},
"stableVersion": "0.1.0"
}

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