@radix-ui/react-label
Advanced tools
Comparing version 0.0.11 to 0.0.12
@@ -1,2 +0,1 @@ | ||
import * as React from "react"; | ||
import { Primitive } from "@radix-ui/react-primitive"; | ||
@@ -10,5 +9,5 @@ import * as Polymorphic from "@radix-ui/react-polymorphic"; | ||
export const Label: LabelPrimitive; | ||
export const useLabelContext: <E extends HTMLElement>(ref?: React.RefObject<E> | undefined) => string | undefined; | ||
export const useLabelContext: (element?: HTMLElement | null | undefined) => string | undefined; | ||
export const Root: LabelPrimitive; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -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),l=(r=require("@babel/runtime/helpers/extends"))&&r.__esModule?r.default:r;const a="span",s=/*#__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(s.Provider,{value:u.useMemo((()=>({id:p,ref:v})),[p])},/*#__PURE__*/u.createElement(i,l({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,n=null==e?void 0:e.current;if(r&&n)return d(r,n)}),[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),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; | ||
//# 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",l=/*#__PURE__*/o.createContext(void 0);export const Label=/*#__PURE__*/o.forwardRef(((c,s)=>{const{as:u=i,htmlFor:d,id:f,...m}=c,b=o.useRef(null),v=r(s,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=a(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(l.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(l);return o.useEffect((()=>{const r=null==t?void 0:t.ref.current,o=null==e?void 0:e.current;if(r&&o)return a(r,o)}),[t,e]),null==t?void 0:t.id};function a(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(((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; | ||
//# sourceMappingURL=index.module.js.map |
{ | ||
"name": "@radix-ui/react-label", | ||
"version": "0.0.11", | ||
"version": "0.0.12", | ||
"license": "MIT", | ||
@@ -22,5 +22,5 @@ "source": "src/index.ts", | ||
"@radix-ui/react-compose-refs": "0.0.5", | ||
"@radix-ui/react-id": "0.0.5", | ||
"@radix-ui/react-polymorphic": "0.0.10", | ||
"@radix-ui/react-primitive": "0.0.11" | ||
"@radix-ui/react-id": "0.0.6", | ||
"@radix-ui/react-polymorphic": "0.0.11", | ||
"@radix-ui/react-primitive": "0.0.12" | ||
}, | ||
@@ -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
19676
26
+ Added@radix-ui/react-id@0.0.6(transitive)
+ Added@radix-ui/react-polymorphic@0.0.11(transitive)
+ Added@radix-ui/react-primitive@0.0.12(transitive)
- Removed@radix-ui/react-id@0.0.5(transitive)
- Removed@radix-ui/react-polymorphic@0.0.10(transitive)
- Removed@radix-ui/react-primitive@0.0.11(transitive)
Updated@radix-ui/react-id@0.0.6