@radix-ui/react-label
Advanced tools
Comparing version 0.0.13 to 0.0.14
@@ -1,2 +0,2 @@ | ||
var e,t,r,n=require("@radix-ui/react-id").useId,i=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/react-compose-refs").useComposedRefs,u=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),a=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const l="span",s=/*#__PURE__*/u.createContext(void 0),c=/*#__PURE__*/u.forwardRef(((e,t)=>{const{as:r=l,htmlFor:c,id:f,...b}=e,v=u.useRef(null),m=o(t,v),p=n(f);return u.useEffect((()=>{const e=v.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[v]),u.useEffect((()=>{if(c){const e=document.getElementById(c),t=v.current;if(t&&e){const r=d(t,e),n=()=>e.getAttribute("aria-labelledby"),i=[n(),p].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",i),()=>{var t;r();const i=null===(t=n())||void 0===t?void 0:t.replace(p,"");""===i?e.removeAttribute("aria-labelledby"):i&&e.setAttribute("aria-labelledby",i)}}}}),[p,c]),/*#__PURE__*/u.createElement(s.Provider,{value:u.useMemo((()=>({id:p,ref:v})),[p])},/*#__PURE__*/u.createElement(i,a({role:"label",id:p},b,{as:r,ref:m})))}));exports.Label=c;function d(e,t){const r=e=>{t.contains(e.target)||(t.click(),t.focus())};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)}exports.useLabelContext=e=>{const t=u.useContext(s);return u.useEffect((()=>{const r=null==t?void 0:t.ref.current;if(r&&e)return d(r,e)}),[t,e]),null==t?void 0:t.id};const f=c;exports.Root=f; | ||
var e,t,r,n=require("@radix-ui/react-id").useId,i=require("@radix-ui/react-primitive").Primitive,o=require("@radix-ui/react-compose-refs").useComposedRefs,u=(e={},t=require("react"),Object.keys(t).forEach((function(r){"default"!==r&&"__esModule"!==r&&Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[r]}})})),e),s=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const a="span",l=/*#__PURE__*/u.createContext(void 0),c=/*#__PURE__*/u.forwardRef(((e,t)=>{const{as:r=a,htmlFor:c,id:f,...b}=e,v=u.useRef(null),m=o(t,v),p=n(f);return u.useEffect((()=>{const e=v.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[v]),u.useEffect((()=>{if(c){const e=document.getElementById(c),t=v.current;if(t&&e){const r=d(t,e),n=()=>e.getAttribute("aria-labelledby"),i=[n(),p].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",i),()=>{var t;r();const i=null===(t=n())||void 0===t?void 0:t.replace(p,"");""===i?e.removeAttribute("aria-labelledby"):i&&e.setAttribute("aria-labelledby",i)}}}}),[p,c]),/*#__PURE__*/u.createElement(l.Provider,{value:u.useMemo((()=>({id:p,ref:v})),[p])},/*#__PURE__*/u.createElement(i,s({role:"label",id:p},b,{as:r,ref:m})))}));exports.Label=c;function d(e,t){const r=e=>{const r=t.contains(e.target),n=!0===e.isTrusted;!r&&n&&(t.click(),t.focus())};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)}exports.useLabelContext=e=>{const t=u.useContext(l);return u.useEffect((()=>{const r=null==t?void 0:t.ref.current;if(r&&e)return d(r,e)}),[t,e]),null==t?void 0:t.id};const f=c;exports.Root=f; | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
import{useId as e}from"@radix-ui/react-id";import{Primitive as t}from"@radix-ui/react-primitive";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import*as o from"react";import n from"@babel/runtime/helpers/esm/extends";const i="span",a=/*#__PURE__*/o.createContext(void 0);export const Label=/*#__PURE__*/o.forwardRef(((s,c)=>{const{as:u=i,htmlFor:d,id:f,...m}=s,b=o.useRef(null),v=r(c,b),p=e(f);return o.useEffect((()=>{const e=b.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[b]),o.useEffect((()=>{if(d){const e=document.getElementById(d),t=b.current;if(t&&e){const r=l(t,e),o=()=>e.getAttribute("aria-labelledby"),n=[o(),p].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",n),()=>{var t;r();const n=null===(t=o())||void 0===t?void 0:t.replace(p,"");""===n?e.removeAttribute("aria-labelledby"):n&&e.setAttribute("aria-labelledby",n)}}}}),[p,d]),/*#__PURE__*/o.createElement(a.Provider,{value:o.useMemo((()=>({id:p,ref:b})),[p])},/*#__PURE__*/o.createElement(t,n({role:"label",id:p},m,{as:u,ref:v})))}));/*#__PURE__*/export const useLabelContext=e=>{const t=o.useContext(a);return o.useEffect((()=>{const r=null==t?void 0:t.ref.current;if(r&&e)return l(r,e)}),[t,e]),null==t?void 0:t.id};function l(e,t){const r=e=>{t.contains(e.target)||(t.click(),t.focus())};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)}export const Root=Label; | ||
import{useId as e}from"@radix-ui/react-id";import{Primitive as t}from"@radix-ui/react-primitive";import{useComposedRefs as r}from"@radix-ui/react-compose-refs";import*as o from"react";import n from"@babel/runtime/helpers/esm/extends";const i="span",a=/*#__PURE__*/o.createContext(void 0);export const Label=/*#__PURE__*/o.forwardRef(((l,c)=>{const{as:u=i,htmlFor:d,id:f,...m}=l,b=o.useRef(null),v=r(c,b),p=e(f);return o.useEffect((()=>{const e=b.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[b]),o.useEffect((()=>{if(d){const e=document.getElementById(d),t=b.current;if(t&&e){const r=s(t,e),o=()=>e.getAttribute("aria-labelledby"),n=[o(),p].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",n),()=>{var t;r();const n=null===(t=o())||void 0===t?void 0:t.replace(p,"");""===n?e.removeAttribute("aria-labelledby"):n&&e.setAttribute("aria-labelledby",n)}}}}),[p,d]),/*#__PURE__*/o.createElement(a.Provider,{value:o.useMemo((()=>({id:p,ref:b})),[p])},/*#__PURE__*/o.createElement(t,n({role:"label",id:p},m,{as:u,ref:v})))}));/*#__PURE__*/export const useLabelContext=e=>{const t=o.useContext(a);return o.useEffect((()=>{const r=null==t?void 0:t.ref.current;if(r&&e)return s(r,e)}),[t,e]),null==t?void 0:t.id};function s(e,t){const r=e=>{const r=t.contains(e.target),o=!0===e.isTrusted;!r&&o&&(t.click(),t.focus())};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)}export const Root=Label; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-label", | ||
"version": "0.0.13", | ||
"version": "0.0.14", | ||
"license": "MIT", | ||
@@ -23,4 +23,4 @@ "source": "src/index.ts", | ||
"@radix-ui/react-id": "0.0.6", | ||
"@radix-ui/react-polymorphic": "0.0.11", | ||
"@radix-ui/react-primitive": "0.0.13" | ||
"@radix-ui/react-polymorphic": "0.0.12", | ||
"@radix-ui/react-primitive": "0.0.14" | ||
}, | ||
@@ -27,0 +27,0 @@ "peerDependencies": { |
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
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
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
20563
+ Added@radix-ui/react-polymorphic@0.0.12(transitive)
+ Added@radix-ui/react-primitive@0.0.14(transitive)
- Removed@radix-ui/react-polymorphic@0.0.11(transitive)
- Removed@radix-ui/react-primitive@0.0.13(transitive)