@purpurds/label
Advanced tools
Comparing version 5.14.0 to 5.15.0
@@ -1,6 +0,6 @@ | ||
"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:{}};/*! | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("react/jsx-runtime"),s=require("react");require("react-dom");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)({}).hasOwnProperty.call(t,l)&&(e[l]=t[l])}return e},i.apply(null,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 m=s.forwardRef((e,r)=>{const{children:t,...l}=e,c=s.Children.toArray(t),n=c.find(E);if(n){const o=n.props.children,a=c.map(p=>p===n?s.Children.count(o)>1?s.Children.only(null):s.isValidElement(o)?o.props.children:null:p);return s.createElement(d,i({},l,{ref:r}),s.isValidElement(o)?s.cloneElement(o,void 0,a):null)}return s.createElement(d,i({},l,{ref:r}),t)});m.displayName="Slot";const d=s.forwardRef((e,r)=>{const{children:t,...l}=e;return s.isValidElement(t)?s.cloneElement(t,{...w(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 h=({children:e})=>s.createElement(s.Fragment,null,e);function E(e){return s.isValidElement(e)&&e.type===h}function w(e,r){const t={...r};for(const l in r){const c=e[l],n=r[l];/^on[A-Z]/.test(l)?c&&n?t[l]=(...a)=>{n(...a),c(...a)}:c&&(t[l]=c):l==="style"?t[l]={...c,...n}:l==="className"&&(t[l]=[c,n].filter(Boolean).join(" "))}return{...e,...t}}const S=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],_=S.reduce((e,r)=>{const t=s.forwardRef((l,c)=>{const{asChild:n,...o}=l,a=n?m:r;return s.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),s.createElement(a,i({},o,{ref:c}))});return t.displayName=`Primitive.${r}`,{...e,[r]:t}},{}),g=s.forwardRef((e,r)=>s.createElement(_.label,i({},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=g;function C(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="",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; | ||
*/(function(e){(function(){var r={}.hasOwnProperty;function t(){for(var n="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(n=c(n,l(a)))}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 a in n)r.call(n,a)&&n[a]&&(o=c(o,a));return o}function c(n,o){return o?n?n+" "+o:n+o:n}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})($);var N=$.exports;const j=C(N),u={"purpur-label":"_purpur-label_12cfi_1","purpur-label--negative":"_purpur-label--negative_12cfi_9","purpur-label--disabled":"_purpur-label--disabled_12cfi_12"},f="purpur-label",O=({children:e,className:r,htmlFor:t,"data-testid":l,disabled:c,negative:n=!1,...o})=>{const a=j([r,u[f],{[u[`${f}--disabled`]]:c,[u[`${f}--negative`]]:n}]);return b.jsx(x,{className:a,"data-testid":l,htmlFor:t,...o,children:e})};exports.Label=O; | ||
//# sourceMappingURL=label.cjs.js.map |
@@ -1,41 +0,30 @@ | ||
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 { jsx as _ } from "react/jsx-runtime"; | ||
import { forwardRef as p, Children as i, isValidElement as f, createElement as u, cloneElement as v, Fragment as x, useEffect as N } from "react"; | ||
import "react-dom"; | ||
function m() { | ||
return m = Object.assign ? Object.assign.bind() : function(e) { | ||
function a() { | ||
return a = 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]); | ||
for (var o in t) ({}).hasOwnProperty.call(t, o) && (e[o] = t[o]); | ||
} | ||
return e; | ||
}, m.apply(this, arguments); | ||
}, a.apply(null, arguments); | ||
} | ||
function f() { | ||
return f = 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; | ||
}, f.apply(this, arguments); | ||
} | ||
function j(e, r) { | ||
function S(e, r) { | ||
typeof e == "function" ? e(r) : e != null && (e.current = r); | ||
} | ||
function w(...e) { | ||
function g(...e) { | ||
return (r) => e.forEach( | ||
(t) => j(t, r) | ||
(t) => S(t, r) | ||
); | ||
} | ||
const y = /* @__PURE__ */ p((e, r) => { | ||
const { children: t, ...o } = e, l = c.toArray(t), n = l.find(S); | ||
const { children: t, ...o } = e, s = i.toArray(t), n = s.find(E); | ||
if (n) { | ||
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, { | ||
const l = n.props.children, c = s.map((b) => b === n ? i.count(l) > 1 ? i.only(null) : /* @__PURE__ */ f(l) ? l.props.children : null : b); | ||
return /* @__PURE__ */ u(m, a({}, o, { | ||
ref: r | ||
}), /* @__PURE__ */ u(s) ? /* @__PURE__ */ h(s, void 0, a) : null); | ||
}), /* @__PURE__ */ f(l) ? /* @__PURE__ */ v(l, void 0, c) : null); | ||
} | ||
return /* @__PURE__ */ i($, f({}, o, { | ||
return /* @__PURE__ */ u(m, a({}, o, { | ||
ref: r | ||
@@ -45,15 +34,15 @@ }), t); | ||
y.displayName = "Slot"; | ||
const $ = /* @__PURE__ */ p((e, r) => { | ||
const m = /* @__PURE__ */ p((e, r) => { | ||
const { children: t, ...o } = e; | ||
return /* @__PURE__ */ u(t) ? /* @__PURE__ */ h(t, { | ||
...P(o, t.props), | ||
ref: r ? w(r, t.ref) : t.ref | ||
}) : c.count(t) > 1 ? c.only(null) : null; | ||
return /* @__PURE__ */ f(t) ? /* @__PURE__ */ v(t, { | ||
...O(o, t.props), | ||
ref: r ? g(r, t.ref) : t.ref | ||
}) : i.count(t) > 1 ? i.only(null) : null; | ||
}); | ||
$.displayName = "SlotClone"; | ||
const N = ({ children: e }) => /* @__PURE__ */ i(_, null, e); | ||
function S(e) { | ||
return /* @__PURE__ */ u(e) && e.type === N; | ||
m.displayName = "SlotClone"; | ||
const w = ({ children: e }) => /* @__PURE__ */ u(x, null, e); | ||
function E(e) { | ||
return /* @__PURE__ */ f(e) && e.type === w; | ||
} | ||
function P(e, r) { | ||
function O(e, r) { | ||
const t = { | ||
@@ -63,10 +52,10 @@ ...r | ||
for (const o in r) { | ||
const l = e[o], n = r[o]; | ||
/^on[A-Z]/.test(o) ? l && n ? t[o] = (...a) => { | ||
n(...a), l(...a); | ||
} : l && (t[o] = l) : o === "style" ? t[o] = { | ||
...l, | ||
const s = e[o], n = r[o]; | ||
/^on[A-Z]/.test(o) ? s && n ? t[o] = (...c) => { | ||
n(...c), s(...c); | ||
} : s && (t[o] = s) : o === "style" ? t[o] = { | ||
...s, | ||
...n | ||
} : o === "className" && (t[o] = [ | ||
l, | ||
s, | ||
n | ||
@@ -80,3 +69,3 @@ ].filter(Boolean).join(" ")); | ||
} | ||
const E = [ | ||
const P = [ | ||
"a", | ||
@@ -98,9 +87,9 @@ "button", | ||
"ul" | ||
], C = E.reduce((e, r) => { | ||
const t = /* @__PURE__ */ p((o, l) => { | ||
const { asChild: n, ...s } = o, a = n ? y : r; | ||
return x(() => { | ||
], j = P.reduce((e, r) => { | ||
const t = /* @__PURE__ */ p((o, s) => { | ||
const { asChild: n, ...l } = o, c = n ? y : r; | ||
return N(() => { | ||
window[Symbol.for("radix-ui")] = !0; | ||
}, []), /* @__PURE__ */ i(a, f({}, s, { | ||
ref: l | ||
}, []), /* @__PURE__ */ u(c, a({}, l, { | ||
ref: s | ||
})); | ||
@@ -112,3 +101,3 @@ }); | ||
}; | ||
}, {}), D = /* @__PURE__ */ p((e, r) => /* @__PURE__ */ i(C.label, m({}, e, { | ||
}, {}), C = /* @__PURE__ */ p((e, r) => /* @__PURE__ */ u(j.label, a({}, e, { | ||
ref: r, | ||
@@ -119,7 +108,7 @@ onMouseDown: (t) => { | ||
} | ||
}))), A = D; | ||
function M(e) { | ||
}))), D = C; | ||
function A(e) { | ||
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; | ||
} | ||
var g = { exports: {} }; | ||
var h = { exports: {} }; | ||
/*! | ||
@@ -134,5 +123,5 @@ Copyright (c) 2018 Jed Watson. | ||
function t() { | ||
for (var n = "", s = 0; s < arguments.length; s++) { | ||
var a = arguments[s]; | ||
a && (n = l(n, o(a))); | ||
for (var n = "", l = 0; l < arguments.length; l++) { | ||
var c = arguments[l]; | ||
c && (n = s(n, o(c))); | ||
} | ||
@@ -150,19 +139,19 @@ return n; | ||
return n.toString(); | ||
var s = ""; | ||
for (var a in n) | ||
r.call(n, a) && n[a] && (s = l(s, a)); | ||
return s; | ||
var l = ""; | ||
for (var c in n) | ||
r.call(n, c) && n[c] && (l = s(l, c)); | ||
return l; | ||
} | ||
function l(n, s) { | ||
return s ? n ? n + " " + s : n + s : n; | ||
function s(n, l) { | ||
return l ? n ? n + " " + l : n + l : n; | ||
} | ||
e.exports ? (t.default = t, e.exports = t) : window.classNames = t; | ||
})(); | ||
})(g); | ||
var V = g.exports; | ||
const F = /* @__PURE__ */ M(V), d = { | ||
})(h); | ||
var M = h.exports; | ||
const V = /* @__PURE__ */ A(M), 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 = ({ | ||
}, $ = "purpur-label", L = ({ | ||
children: e, | ||
@@ -172,19 +161,19 @@ className: r, | ||
"data-testid": o, | ||
disabled: l, | ||
disabled: s, | ||
negative: n = !1, | ||
...s | ||
...l | ||
}) => { | ||
const a = F([ | ||
const c = V([ | ||
r, | ||
d[b], | ||
d[$], | ||
{ | ||
[d[`${b}--disabled`]]: l, | ||
[d[`${b}--negative`]]: n | ||
[d[`${$}--disabled`]]: s, | ||
[d[`${$}--negative`]]: n | ||
} | ||
]); | ||
return /* @__PURE__ */ O(A, { className: a, "data-testid": o, htmlFor: t, ...s, children: e }); | ||
return /* @__PURE__ */ _(D, { className: c, "data-testid": o, htmlFor: t, ...l, children: e }); | ||
}; | ||
export { | ||
Z as Label | ||
L as Label | ||
}; | ||
//# sourceMappingURL=label.es.js.map |
Name: @babel/runtime | ||
Version: 7.22.15 | ||
Version: 7.25.6 | ||
License: MIT | ||
@@ -4,0 +4,0 @@ Private: false |
{ | ||
"name": "@purpurds/label", | ||
"version": "5.14.0", | ||
"version": "5.15.0", | ||
"license": "AGPL-3.0-only", | ||
@@ -19,4 +19,4 @@ "main": "./dist/label.cjs.js", | ||
"classnames": "~2.5.0", | ||
"@purpurds/tokens": "5.14.0", | ||
"@purpurds/icon": "5.14.0" | ||
"@purpurds/icon": "5.15.0", | ||
"@purpurds/tokens": "5.15.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
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
62976
343
14
+ Added@purpurds/icon@5.15.0(transitive)
+ Added@purpurds/tokens@5.15.0(transitive)
- Removed@purpurds/icon@5.14.0(transitive)
- Removed@purpurds/tokens@5.14.0(transitive)
Updated@purpurds/icon@5.15.0
Updated@purpurds/tokens@5.15.0