@radix-ui/react-label
Advanced tools
Comparing version 0.0.7 to 0.0.8
@@ -1,2 +0,2 @@ | ||
function e(e){return e&&e.__esModule?e.default:e}function r(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}var t=require("@radix-ui/react-id").useId,n=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-compose-refs").useComposedRefs,u=require("react"),o=u.createContext,a=u.forwardRef,l=u.useRef,c=u.useEffect,s=u.createElement,d=u.useMemo,f=u.useContext,v=e(require("@babel/runtime-corejs3/core-js-stable/instance/filter")),b=e(require("@babel/runtime-corejs3/helpers/objectWithoutProperties")),m=e(require("@babel/runtime-corejs3/helpers/extends"));require("core-js/modules/es.string.replace.js");var p={},x=o(void 0),j=a((function(e,r){var u=e.as,o=void 0===u?"span":u,a=e.htmlFor,f=e.id,p=b(e,["as","htmlFor","id"]),j=l(null),L=i(r,j),y=t(f);return c((function(){var e=j.current;if(e){var r=function(e){e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",r),function(){return e.removeEventListener("mousedown",r)}}}),[j]),c((function(){if(a){var e=document.getElementById(a),r=j.current;if(r&&e){var t,n=q(r,e),i=function(){return e.getAttribute("aria-labelledby")},u=v(t=[i(),y]).call(t,Boolean).join(" ");return e.setAttribute("aria-labelledby",u),function(){var r;n();var t=null===(r=i())||void 0===r?void 0:r.replace(y,"");""===t?e.removeAttribute("aria-labelledby"):t&&e.setAttribute("aria-labelledby",t)}}}}),[y,a]),s(x.Provider,{value:d((function(){return{id:y,ref:j}}),[y])},s(n,m({role:"label",id:y},p,{as:o,ref:L})))}));exports.Label=j,j.displayName="Label";var L=function(e){var r=f(x);return c((function(){var t=null==r?void 0:r.ref.current,n=null==e?void 0:e.current;if(t&&n)return q(t,n)}),[r,e]),null==r?void 0:r.id};function q(e,r){var t=function(e){r.contains(e.target)||(r.click(),r.focus())};return e.addEventListener("click",t),function(){return e.removeEventListener("click",t)}}exports.useLabelContext=L;var y=j;exports.Root=y,r(p,"useLabelContext",(function(){return L})),r(p,"Root",(function(){return y})),r(p,"Label",(function(){return j})); | ||
function e(e,t,r){Object.defineProperty(e,t,{get:r,enumerable:!0})}var t,r=require("@radix-ui/react-id").useId,n=require("@radix-ui/react-primitive").Primitive,i=require("@radix-ui/react-compose-refs").useComposedRefs,o=require("react"),u=o.createContext,l=o.forwardRef,a=o.useRef,s=o.useEffect,c=o.createElement,d=o.useMemo,f=o.useContext,b=(t=require("@babel/runtime/helpers/extends"))&&t.__esModule?t.default:t,v={};const m="span",p=u(void 0),x=l(((e,t)=>{const{as:o=m,htmlFor:u,id:l,...f}=e,v=a(null),x=i(t,v),L=r(l);return s((()=>{const e=v.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[v]),s((()=>{if(u){const e=document.getElementById(u),t=v.current;if(t&&e){const r=y(t,e),n=()=>e.getAttribute("aria-labelledby"),i=[n(),L].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",i),()=>{var t;r();const i=null===(t=n())||void 0===t?void 0:t.replace(L,"");""===i?e.removeAttribute("aria-labelledby"):i&&e.setAttribute("aria-labelledby",i)}}}}),[L,u]),c(p.Provider,{value:d((()=>({id:L,ref:v})),[L])},c(n,b({role:"label",id:L},f,{as:o,ref:x})))}));exports.Label=x,x.displayName="Label";const L=e=>{const t=f(p);return s((()=>{const r=null==t?void 0:t.ref.current,n=null==e?void 0:e.current;if(r&&n)return y(r,n)}),[t,e]),null==t?void 0:t.id};function y(e,t){const r=e=>{t.contains(e.target)||(t.click(),t.focus())};return e.addEventListener("click",r),()=>e.removeEventListener("click",r)}exports.useLabelContext=L;const E=x;exports.Root=E,e(v,"useLabelContext",(function(){return L})),e(v,"Root",(function(){return E})),e(v,"Label",(function(){return x})); | ||
//# sourceMappingURL=index.js.map |
@@ -1,2 +0,2 @@ | ||
function e(e,r,t){Object.defineProperty(e,r,{get:t,enumerable:!0})}import{useId as r}from"@radix-ui/react-id";import{Primitive as t}from"@radix-ui/react-primitive";import{useComposedRefs as n}from"@radix-ui/react-compose-refs";import{createContext as i,forwardRef as o,useRef as a,useEffect as u,createElement as l,useMemo as c,useContext as s}from"react";import f from"@babel/runtime-corejs3/core-js-stable/instance/filter";import d from"@babel/runtime-corejs3/helpers/esm/objectWithoutProperties";import m from"@babel/runtime-corejs3/helpers/esm/extends";import"core-js/modules/es.string.replace.js";var b={},v=i(void 0);export var Label=o((function(e,i){var o=e.as,s=void 0===o?"span":o,b=e.htmlFor,L=e.id,x=d(e,["as","htmlFor","id"]),j=a(null),y=n(i,j),g=r(L);return u((function(){var e=j.current;if(e){var r=function(e){e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",r),function(){return e.removeEventListener("mousedown",r)}}}),[j]),u((function(){if(b){var e=document.getElementById(b),r=j.current;if(r&&e){var t,n=p(r,e),i=function(){return e.getAttribute("aria-labelledby")},o=f(t=[i(),g]).call(t,Boolean).join(" ");return e.setAttribute("aria-labelledby",o),function(){var r;n();var t=null===(r=i())||void 0===r?void 0:r.replace(g,"");""===t?e.removeAttribute("aria-labelledby"):t&&e.setAttribute("aria-labelledby",t)}}}}),[g,b]),l(v.Provider,{value:c((function(){return{id:g,ref:j}}),[g])},l(t,m({role:"label",id:g},x,{as:s,ref:y})))}));Label.displayName="Label";export var useLabelContext=function(e){var r=s(v);return u((function(){var t=null==r?void 0:r.ref.current,n=null==e?void 0:e.current;if(t&&n)return p(t,n)}),[r,e]),null==r?void 0:r.id};function p(e,r){var t=function(e){r.contains(e.target)||(r.click(),r.focus())};return e.addEventListener("click",t),function(){return e.removeEventListener("click",t)}}export var Root=Label;e(b,"useLabelContext",(function(){return useLabelContext})),e(b,"Root",(function(){return Root})),e(b,"Label",(function(){return Label})); | ||
function e(e,t,r){Object.defineProperty(e,t,{get:r,enumerable:!0})}import{useId as t}from"@radix-ui/react-id";import{Primitive as r}from"@radix-ui/react-primitive";import{useComposedRefs as n}from"@radix-ui/react-compose-refs";import{createContext as o,forwardRef as i,useRef as l,useEffect as a,createElement as u,useMemo as c,useContext as s}from"react";import d from"@babel/runtime/helpers/esm/extends";var b={};const m="span",f=o(void 0);export const Label=i(((e,o)=>{const{as:i=m,htmlFor:s,id:b,...p}=e,L=l(null),x=n(o,L),y=t(b);return a((()=>{const e=L.current;if(e){const t=e=>{e.detail>1&&e.preventDefault()};return e.addEventListener("mousedown",t),()=>e.removeEventListener("mousedown",t)}}),[L]),a((()=>{if(s){const e=document.getElementById(s),t=L.current;if(t&&e){const r=v(t,e),n=()=>e.getAttribute("aria-labelledby"),o=[n(),y].filter(Boolean).join(" ");return e.setAttribute("aria-labelledby",o),()=>{var t;r();const o=null===(t=n())||void 0===t?void 0:t.replace(y,"");""===o?e.removeAttribute("aria-labelledby"):o&&e.setAttribute("aria-labelledby",o)}}}}),[y,s]),u(f.Provider,{value:c((()=>({id:y,ref:L})),[y])},u(r,d({role:"label",id:y},p,{as:i,ref:x})))}));Label.displayName="Label";export const useLabelContext=e=>{const t=s(f);return a((()=>{const r=null==t?void 0:t.ref.current,n=null==e?void 0:e.current;if(r&&n)return v(r,n)}),[t,e]),null==t?void 0:t.id};function v(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;e(b,"useLabelContext",(function(){return useLabelContext})),e(b,"Root",(function(){return Root})),e(b,"Label",(function(){return Label})); | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-label", | ||
"version": "0.0.7", | ||
"version": "0.0.8", | ||
"license": "MIT", | ||
@@ -20,7 +20,7 @@ "source": "src/index.ts", | ||
"dependencies": { | ||
"@babel/runtime-corejs3": "^7.13.10", | ||
"@babel/runtime": "^7.13.10", | ||
"@radix-ui/react-compose-refs": "0.0.2", | ||
"@radix-ui/react-id": "0.0.2", | ||
"@radix-ui/react-polymorphic": "0.0.7", | ||
"@radix-ui/react-primitive": "0.0.7" | ||
"@radix-ui/react-primitive": "0.0.8" | ||
}, | ||
@@ -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
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
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
0
20724
28
+ Added@babel/runtime@^7.13.10
+ Added@babel/runtime@7.26.0(transitive)
+ Added@radix-ui/react-primitive@0.0.8(transitive)
- Removed@babel/runtime-corejs3@^7.13.10
- Removed@radix-ui/react-primitive@0.0.7(transitive)