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

@purpurds/label

Package Overview
Dependencies
Maintainers
2
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/label - npm Package Compare versions

Comparing version 4.6.0 to 5.0.0

4

dist/label.cjs.js

@@ -1,6 +0,6 @@

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("react/jsx-runtime"),s=require("react");require("react-dom");function u(){return u=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},u.apply(this,arguments)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},i.apply(this,arguments)}function v(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function y(...e){return r=>e.forEach(t=>v(t,r))}const b=s.forwardRef((e,r)=>{const{children:t,...o}=e,a=s.Children.toArray(t),n=a.find(O);if(n){const l=n.props.children,c=a.map(d=>d===n?s.Children.count(l)>1?s.Children.only(null):s.isValidElement(l)?l.props.children:null:d);return s.createElement(f,i({},o,{ref:r}),s.isValidElement(l)?s.cloneElement(l,void 0,c):null)}return s.createElement(f,i({},o,{ref:r}),t)});b.displayName="Slot";const f=s.forwardRef((e,r)=>{const{children:t,...o}=e;return s.isValidElement(t)?s.cloneElement(t,{...j(o,t.props),ref:r?y(r,t.ref):t.ref}):s.Children.count(t)>1?s.Children.only(null):null});f.displayName="SlotClone";const E=({children:e})=>s.createElement(s.Fragment,null,e);function O(e){return s.isValidElement(e)&&e.type===E}function j(e,r){const t={...r};for(const o in r){const a=e[o],n=r[o];/^on[A-Z]/.test(o)?a&&n?t[o]=(...c)=>{n(...c),a(...c)}:a&&(t[o]=a):o==="style"?t[o]={...a,...n}:o==="className"&&(t[o]=[a,n].filter(Boolean).join(" "))}return{...e,...t}}const w=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],g=w.reduce((e,r)=>{const t=s.forwardRef((o,a)=>{const{asChild:n,...l}=o,c=n?b:r;return s.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),s.createElement(c,i({},l,{ref:a}))});return t.displayName=`Primitive.${r}`,{...e,[r]:t}},{}),x=s.forwardRef((e,r)=>s.createElement(g.label,u({},e,{ref:r,onMouseDown:t=>{var o;(o=e.onMouseDown)===null||o===void 0||o.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))),S=x;function C(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $={exports:{}};/*!
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("react/jsx-runtime"),s=require("react");require("react-dom");function p(){return p=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},p.apply(this,arguments)}function i(){return i=Object.assign?Object.assign.bind():function(e){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var l in t)Object.prototype.hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},i.apply(this,arguments)}function h(e,r){typeof e=="function"?e(r):e!=null&&(e.current=r)}function y(...e){return r=>e.forEach(t=>h(t,r))}const b=s.forwardRef((e,r)=>{const{children:t,...l}=e,a=s.Children.toArray(t),n=a.find(g);if(n){const o=n.props.children,c=a.map(m=>m===n?s.Children.count(o)>1?s.Children.only(null):s.isValidElement(o)?o.props.children:null:m);return s.createElement(d,i({},l,{ref:r}),s.isValidElement(o)?s.cloneElement(o,void 0,c):null)}return s.createElement(d,i({},l,{ref:r}),t)});b.displayName="Slot";const d=s.forwardRef((e,r)=>{const{children:t,...l}=e;return s.isValidElement(t)?s.cloneElement(t,{...O(l,t.props),ref:r?y(r,t.ref):t.ref}):s.Children.count(t)>1?s.Children.only(null):null});d.displayName="SlotClone";const E=({children:e})=>s.createElement(s.Fragment,null,e);function g(e){return s.isValidElement(e)&&e.type===E}function O(e,r){const t={...r};for(const l in r){const a=e[l],n=r[l];/^on[A-Z]/.test(l)?a&&n?t[l]=(...c)=>{n(...c),a(...c)}:a&&(t[l]=a):l==="style"?t[l]={...a,...n}:l==="className"&&(t[l]=[a,n].filter(Boolean).join(" "))}return{...e,...t}}const j=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],w=j.reduce((e,r)=>{const t=s.forwardRef((l,a)=>{const{asChild:n,...o}=l,c=n?b:r;return s.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),s.createElement(c,i({},o,{ref:a}))});return t.displayName=`Primitive.${r}`,{...e,[r]:t}},{}),_=s.forwardRef((e,r)=>s.createElement(w.label,p({},e,{ref:r,onMouseDown:t=>{var l;(l=e.onMouseDown)===null||l===void 0||l.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault()}}))),x=_;function S(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var n="",l=0;l<arguments.length;l++){var c=arguments[l];c&&(n=a(n,o(c)))}return n}function o(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var l="";for(var c in n)r.call(n,c)&&n[c]&&(l=a(l,c));return l}function a(n,l){return l?n?n+" "+l:n+l:n}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($);var N=$.exports;const P=C(N),p={"purpur-label":"_purpur-label_1tkut_1","purpur-label--disabled":"_purpur-label--disabled_1tkut_9"},m="purpur-label",_=({children:e,className:r,htmlFor:t,"data-testid":o,disabled:a,...n})=>{const l=P([r,p[m],{[p[`${m}--disabled`]]:a}]);return h.jsx(S,{className:l,"data-testid":o,htmlFor:t,...n,children:e})};exports.Label=_;
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var n="",o=0;o<arguments.length;o++){var c=arguments[o];c&&(n=a(n,l(c)))}return n}function l(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n!="object")return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var o="";for(var c in n)r.call(n,c)&&n[c]&&(o=a(o,c));return o}function a(n,o){return o?n?n+" "+o:n+o:n}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($);var C=$.exports;const N=S(C),f={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},u="purpur-label",P=({children:e,className:r,htmlFor:t,"data-testid":l,disabled:a,negative:n=!1,...o})=>{const c=N([r,f[u],{[f[`${u}--disabled`]]:a,[f[`${u}--negative`]]:n}]);return v.jsx(x,{className:c,"data-testid":l,htmlFor:t,...o,children:e})};exports.Label=P;
//# sourceMappingURL=label.cjs.js.map

@@ -9,4 +9,5 @@ import { default as React, ReactNode } from 'react';

disabled?: boolean;
negative?: boolean;
};
export declare const Label: ({ children, className, htmlFor, "data-testid": dataTestId, disabled, ...props }: LabelProps) => React.JSX.Element;
export declare const Label: ({ children, className, htmlFor, "data-testid": dataTestId, disabled, negative, ...props }: LabelProps) => React.JSX.Element;
//# sourceMappingURL=label.d.ts.map

@@ -1,6 +0,6 @@

import { jsx as x } from "react/jsx-runtime";
import { forwardRef as p, Children as a, isValidElement as u, createElement as i, cloneElement as h, Fragment as j, useEffect as g } from "react";
import { jsx as O } from "react/jsx-runtime";
import { forwardRef as p, Children as c, isValidElement as u, createElement as i, cloneElement as h, Fragment as _, useEffect as x } from "react";
import "react-dom";
function d() {
return d = Object.assign ? Object.assign.bind() : function(e) {
function m() {
return m = Object.assign ? Object.assign.bind() : function(e) {
for (var r = 1; r < arguments.length; r++) {

@@ -12,3 +12,3 @@ var t = arguments[r];

return e;
}, d.apply(this, arguments);
}, m.apply(this, arguments);
}

@@ -25,19 +25,19 @@ function f() {

}
function w(e, r) {
function j(e, r) {
typeof e == "function" ? e(r) : e != null && (e.current = r);
}
function N(...e) {
function w(...e) {
return (r) => e.forEach(
(t) => w(t, r)
(t) => j(t, r)
);
}
const y = /* @__PURE__ */ p((e, r) => {
const { children: t, ...o } = e, l = a.toArray(t), n = l.find(_);
const { children: t, ...o } = e, l = c.toArray(t), n = l.find(S);
if (n) {
const s = n.props.children, c = l.map(($) => $ === n ? a.count(s) > 1 ? a.only(null) : /* @__PURE__ */ u(s) ? s.props.children : null : $);
return /* @__PURE__ */ i(m, f({}, o, {
const s = n.props.children, a = l.map((v) => v === n ? c.count(s) > 1 ? c.only(null) : /* @__PURE__ */ u(s) ? s.props.children : null : v);
return /* @__PURE__ */ i($, f({}, o, {
ref: r
}), /* @__PURE__ */ u(s) ? /* @__PURE__ */ h(s, void 0, c) : null);
}), /* @__PURE__ */ u(s) ? /* @__PURE__ */ h(s, void 0, a) : null);
}
return /* @__PURE__ */ i(m, f({}, o, {
return /* @__PURE__ */ i($, f({}, o, {
ref: r

@@ -47,13 +47,13 @@ }), t);

y.displayName = "Slot";
const m = /* @__PURE__ */ p((e, r) => {
const $ = /* @__PURE__ */ p((e, r) => {
const { children: t, ...o } = e;
return /* @__PURE__ */ u(t) ? /* @__PURE__ */ h(t, {
...P(o, t.props),
ref: r ? N(r, t.ref) : t.ref
}) : a.count(t) > 1 ? a.only(null) : null;
ref: r ? w(r, t.ref) : t.ref
}) : c.count(t) > 1 ? c.only(null) : null;
});
m.displayName = "SlotClone";
const S = ({ children: e }) => /* @__PURE__ */ i(j, null, e);
function _(e) {
return /* @__PURE__ */ u(e) && e.type === S;
$.displayName = "SlotClone";
const N = ({ children: e }) => /* @__PURE__ */ i(_, null, e);
function S(e) {
return /* @__PURE__ */ u(e) && e.type === N;
}

@@ -66,4 +66,4 @@ function P(e, r) {

const l = e[o], n = r[o];
/^on[A-Z]/.test(o) ? l && n ? t[o] = (...c) => {
n(...c), l(...c);
/^on[A-Z]/.test(o) ? l && n ? t[o] = (...a) => {
n(...a), l(...a);
} : l && (t[o] = l) : o === "style" ? t[o] = {

@@ -101,6 +101,6 @@ ...l,

const t = /* @__PURE__ */ p((o, l) => {
const { asChild: n, ...s } = o, c = n ? y : r;
return g(() => {
const { asChild: n, ...s } = o, a = n ? y : r;
return x(() => {
window[Symbol.for("radix-ui")] = !0;
}, []), /* @__PURE__ */ i(c, f({}, s, {
}, []), /* @__PURE__ */ i(a, f({}, s, {
ref: l

@@ -113,3 +113,3 @@ }));

};
}, {}), D = /* @__PURE__ */ p((e, r) => /* @__PURE__ */ i(C.label, d({}, e, {
}, {}), D = /* @__PURE__ */ p((e, r) => /* @__PURE__ */ i(C.label, m({}, e, {
ref: r,

@@ -124,3 +124,3 @@ onMouseDown: (t) => {

}
var O = { exports: {} };
var g = { exports: {} };
/*!

@@ -136,4 +136,4 @@ Copyright (c) 2018 Jed Watson.

for (var n = "", s = 0; s < arguments.length; s++) {
var c = arguments[s];
c && (n = l(n, o(c)));
var a = arguments[s];
a && (n = l(n, o(a)));
}

@@ -152,4 +152,4 @@ return n;

var s = "";
for (var c in n)
r.call(n, c) && n[c] && (s = l(s, c));
for (var a in n)
r.call(n, a) && n[a] && (s = l(s, a));
return s;

@@ -162,8 +162,9 @@ }

})();
})(O);
var V = O.exports;
const F = /* @__PURE__ */ M(V), b = {
"purpur-label": "_purpur-label_1tkut_1",
"purpur-label--disabled": "_purpur-label--disabled_1tkut_9"
}, v = "purpur-label", Z = ({
})(g);
var V = g.exports;
const F = /* @__PURE__ */ M(V), d = {
"purpur-label": "_purpur-label_12cfi_1",
"purpur-label--negative": "_purpur-label--negative_12cfi_9",
"purpur-label--disabled": "_purpur-label--disabled_12cfi_12"
}, b = "purpur-label", Z = ({
children: e,

@@ -174,10 +175,14 @@ className: r,

disabled: l,
...n
negative: n = !1,
...s
}) => {
const s = F([
const a = F([
r,
b[v],
{ [b[`${v}--disabled`]]: l }
d[b],
{
[d[`${b}--disabled`]]: l,
[d[`${b}--negative`]]: n
}
]);
return /* @__PURE__ */ x(A, { className: s, "data-testid": o, htmlFor: t, ...n, children: e });
return /* @__PURE__ */ O(A, { className: a, "data-testid": o, htmlFor: t, ...s, children: e });
};

@@ -184,0 +189,0 @@ export {

{
"name": "@purpurds/label",
"version": "4.6.0",
"version": "5.0.0",
"license": "AGPL-3.0-only",

@@ -19,4 +19,4 @@ "main": "./dist/label.cjs.js",

"classnames": "~2.5.0",
"@purpurds/icon": "4.6.0",
"@purpurds/tokens": "4.6.0"
"@purpurds/icon": "5.0.0",
"@purpurds/tokens": "5.0.0"
},

@@ -23,0 +23,0 @@ "devDependencies": {

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

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

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