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

@purpurds/button

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@purpurds/button - npm Package Compare versions

Comparing version 5.5.0 to 5.6.0

6

dist/button.cjs.js

@@ -1,10 +0,10 @@

"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),w={PRIMARY:"primary",SECONDARY:"secondary",EXPRESSIVE:"expressive"},x={SM:"sm",MD:"md",LG:"lg"};function R(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var g={exports:{}};/*!
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),T=require("react"),w={PRIMARY:"primary",SECONDARY:"secondary",EXPRESSIVE:"expressive"},x={SM:"sm",MD:"md",LG:"lg"};function R(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var g={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(u){(function(){var o={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var e=arguments[r];e&&(t=s(t,p(e)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var e in t)o.call(t,e)&&t[e]&&(r=s(r,e));return r}function s(t,r){return r?t?t+" "+r:t+r:t}u.exports?(n.default=n,u.exports=n):window.classNames=n})()})(g);var A=g.exports;const m=R(A),E="_rotate_1xozj_1",M="_dash_1xozj_1",a={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:E,"purpur-spinner--xxs":"_purpur-spinner--xxs_1xozj_4","purpur-spinner--xs":"_purpur-spinner--xs_1xozj_8","purpur-spinner--sm":"_purpur-spinner--sm_1xozj_12","purpur-spinner--md":"_purpur-spinner--md_1xozj_16","purpur-spinner--lg":"_purpur-spinner--lg_1xozj_20","purpur-spinner__circle":"_purpur-spinner__circle_1xozj_24",dash:M,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},c="purpur-spinner",P={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},B=({["data-testid"]:u,disabled:o=!1,negative:n=!1,size:p=P.SM,...s})=>l.jsx("div",{className:m([a[c],a[`${c}--${p}`]]),"data-testid":u,...s,children:l.jsx("svg",{viewBox:"0 0 50 50",children:l.jsx("circle",{className:m(a[`${c}__circle`],{[a[`${c}__circle--disabled`]]:o,[a[`${c}__circle--negative`]]:n}),cx:"25",cy:"25",r:"20"})})});function D(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var j={exports:{}};/*!
*/(function(u){(function(){var o={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var e=arguments[r];e&&(t=s(t,p(e)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var e in t)o.call(t,e)&&t[e]&&(r=s(r,e));return r}function s(t,r){return r?t?t+" "+r:t+r:t}u.exports?(n.default=n,u.exports=n):window.classNames=n})()})(g);var A=g.exports;const m=R(A),E="_rotate_1xozj_1",M="_dash_1xozj_1",_={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:E,"purpur-spinner--xxs":"_purpur-spinner--xxs_1xozj_4","purpur-spinner--xs":"_purpur-spinner--xs_1xozj_8","purpur-spinner--sm":"_purpur-spinner--sm_1xozj_12","purpur-spinner--md":"_purpur-spinner--md_1xozj_16","purpur-spinner--lg":"_purpur-spinner--lg_1xozj_20","purpur-spinner__circle":"_purpur-spinner__circle_1xozj_24",dash:M,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},a="purpur-spinner",P={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},B=({["data-testid"]:u,disabled:o=!1,negative:n=!1,size:p=P.SM,...s})=>c.jsx("div",{className:m([_[a],_[`${a}--${p}`]]),"data-testid":u,...s,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:m(_[`${a}__circle`],{[_[`${a}__circle--disabled`]]:o,[_[`${a}__circle--negative`]]:n}),cx:"25",cy:"25",r:"20"})})});function D(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var j={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(u){(function(){var o={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var e=arguments[r];e&&(t=s(t,p(e)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var e in t)o.call(t,e)&&t[e]&&(r=s(r,e));return r}function s(t,r){return r?t?t+" "+r:t+r:t}u.exports?(n.default=n,u.exports=n):window.classNames=n})()})(j);var V=j.exports;const I=D(V),i={"purpur-button":"_purpur-button_u2yv5_1","purpur-button--sm":"_purpur-button--sm_u2yv5_33","purpur-button--icon-only":"_purpur-button--icon-only_u2yv5_36","purpur-button--md":"_purpur-button--md_u2yv5_39","purpur-button--lg":"_purpur-button--lg_u2yv5_45","purpur-button--full-width":"_purpur-button--full-width_u2yv5_51","purpur-button--primary":"_purpur-button--primary_u2yv5_54","purpur-button--disabled":"_purpur-button--disabled_u2yv5_58","purpur-button--primary-negative":"_purpur-button--primary-negative_u2yv5_64","purpur-button--secondary":"_purpur-button--secondary_u2yv5_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_u2yv5_87","purpur-button--expressive":"_purpur-button--expressive_u2yv5_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_u2yv5_108","purpur-button--negative":"_purpur-button--negative_u2yv5_120","purpur-button--destructive":"_purpur-button--destructive_u2yv5_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_u2yv5_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_u2yv5_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_u2yv5_160","purpur-button--text-negative":"_purpur-button--text-negative_u2yv5_175","purpur-button--text":"_purpur-button--text_u2yv5_175"},S={...w,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},C=Object.values(S),_="purpur-button",X=({children:u,className:o,["data-testid"]:n,disabled:p=!1,fullWidth:s=!1,iconOnly:t,loading:r=!1,negative:e=!1,onClick:d,size:b=x.MD,variant:v,type:$="button",...y},z)=>{if(t&&v==="destructive")return null;const N=I([i[_],i[`${_}--${e?`${v}-negative`:v}`],i[`${_}--${b}`]],{[i[`${_}--icon-only`]]:t,[i[`${_}--negative`]]:e,[i[`${_}--full-width`]]:s,[i[`${_}--disabled`]]:p||r},o),O=f=>{p||r?f.preventDefault():d&&d(f)};return l.jsxs("button",{className:N,"data-testid":n,type:$,ref:z,"aria-disabled":y["aria-disabled"]||p||r,onClick:O,...y,children:[r&&l.jsx(B,{size:b===x.LG?"xs":"xxs",negative:e,disabled:p})," ",u]})},h=T.forwardRef(X);h.displayName="Button";exports.BUTTON_VARIANT=S;exports.Button=h;exports.buttonVariants=C;
*/(function(u){(function(){var o={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var e=arguments[r];e&&(t=s(t,p.call(this,e)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return n.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var e in t)o.call(t,e)&&t[e]&&(r=s(r,this&&this[e]||e));return r}function s(t,r){return r?t?t+" "+r:t+r:t}u.exports?(n.default=n,u.exports=n):window.classNames=n})()})(j);var V=j.exports;const I=D(V),C={"purpur-button":"_purpur-button_u2yv5_1","purpur-button--sm":"_purpur-button--sm_u2yv5_33","purpur-button--icon-only":"_purpur-button--icon-only_u2yv5_36","purpur-button--md":"_purpur-button--md_u2yv5_39","purpur-button--lg":"_purpur-button--lg_u2yv5_45","purpur-button--full-width":"_purpur-button--full-width_u2yv5_51","purpur-button--primary":"_purpur-button--primary_u2yv5_54","purpur-button--disabled":"_purpur-button--disabled_u2yv5_58","purpur-button--primary-negative":"_purpur-button--primary-negative_u2yv5_64","purpur-button--secondary":"_purpur-button--secondary_u2yv5_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_u2yv5_87","purpur-button--expressive":"_purpur-button--expressive_u2yv5_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_u2yv5_108","purpur-button--negative":"_purpur-button--negative_u2yv5_120","purpur-button--destructive":"_purpur-button--destructive_u2yv5_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_u2yv5_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_u2yv5_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_u2yv5_160","purpur-button--text-negative":"_purpur-button--text-negative_u2yv5_175","purpur-button--text":"_purpur-button--text_u2yv5_175"},h={...w,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},X=Object.values(h),L=I.bind(C),i="purpur-button",U=({children:u,className:o,["data-testid"]:n,disabled:p=!1,fullWidth:s=!1,iconOnly:t,loading:r=!1,negative:e=!1,onClick:d,size:b=x.MD,variant:l,type:$="button",...v},z)=>{if(t&&l==="destructive")return null;const N=L([i,`${i}--${e?`${l}-negative`:l}`,`${i}--${b}`],{[`${i}--icon-only`]:t,[`${i}--negative`]:e,[`${i}--full-width`]:s,[`${i}--disabled`]:p||r},o),O=f=>{p||r?f.preventDefault():d&&d(f)},y=!!v["aria-disabled"]||p||r;return c.jsxs("button",{className:N,"data-testid":n,type:$,ref:z,"aria-disabled":y,onClick:O,...v,children:[r&&c.jsx(B,{size:b===x.LG?"xs":"xxs",negative:e,disabled:y})," ",u]})},S=T.forwardRef(U);S.displayName="Button";exports.BUTTON_VARIANT=h;exports.Button=S;exports.buttonVariants=X;
//# sourceMappingURL=button.cjs.js.map

@@ -1,2 +0,2 @@

import { jsx as l, jsxs as w } from "react/jsx-runtime";
import { jsx as c, jsxs as w } from "react/jsx-runtime";
import { forwardRef as E } from "react";

@@ -25,24 +25,24 @@ const N = {

function n() {
for (var r = "", t = 0; t < arguments.length; t++) {
var e = arguments[t];
e && (r = s(r, p(e)));
for (var t = "", r = 0; r < arguments.length; r++) {
var e = arguments[r];
e && (t = s(t, p(e)));
}
return r;
return t;
}
function p(r) {
if (typeof r == "string" || typeof r == "number")
return r;
if (typeof r != "object")
function p(t) {
if (typeof t == "string" || typeof t == "number")
return t;
if (typeof t != "object")
return "";
if (Array.isArray(r))
return n.apply(null, r);
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
return r.toString();
var t = "";
for (var e in r)
o.call(r, e) && r[e] && (t = s(t, e));
return t;
if (Array.isArray(t))
return n.apply(null, t);
if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
return t.toString();
var r = "";
for (var e in t)
o.call(t, e) && t[e] && (r = s(r, e));
return r;
}
function s(r, t) {
return t ? r ? r + " " + t : r + t : r;
function s(t, r) {
return r ? t ? t + " " + r : t + r : t;
}

@@ -53,3 +53,3 @@ u.exports ? (n.default = n, u.exports = n) : window.classNames = n;

var R = g.exports;
const m = /* @__PURE__ */ O(R), A = "_rotate_1xozj_1", M = "_dash_1xozj_1", a = {
const m = /* @__PURE__ */ O(R), A = "_rotate_1xozj_1", M = "_dash_1xozj_1", _ = {
"purpur-spinner": "_purpur-spinner_1xozj_1",

@@ -66,3 +66,3 @@ rotate: A,

"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
}, c = "purpur-spinner", T = {
}, a = "purpur-spinner", T = {
XXS: "xxs",

@@ -79,14 +79,14 @@ XS: "xs",

...s
}) => /* @__PURE__ */ l(
}) => /* @__PURE__ */ c(
"div",
{
className: m([a[c], a[`${c}--${p}`]]),
className: m([_[a], _[`${a}--${p}`]]),
"data-testid": u,
...s,
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ l(
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ c(
"circle",
{
className: m(a[`${c}__circle`], {
[a[`${c}__circle--disabled`]]: o,
[a[`${c}__circle--negative`]]: n
className: m(_[`${a}__circle`], {
[_[`${a}__circle--disabled`]]: o,
[_[`${a}__circle--negative`]]: n
}),

@@ -103,3 +103,3 @@ cx: "25",

}
var j = { exports: {} };
var h = { exports: {} };
/*!

@@ -114,30 +114,30 @@ Copyright (c) 2018 Jed Watson.

function n() {
for (var r = "", t = 0; t < arguments.length; t++) {
var e = arguments[t];
e && (r = s(r, p(e)));
for (var t = "", r = 0; r < arguments.length; r++) {
var e = arguments[r];
e && (t = s(t, p.call(this, e)));
}
return r;
return t;
}
function p(r) {
if (typeof r == "string" || typeof r == "number")
return r;
if (typeof r != "object")
function p(t) {
if (typeof t == "string" || typeof t == "number")
return this && this[t] || t;
if (typeof t != "object")
return "";
if (Array.isArray(r))
return n.apply(null, r);
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
return r.toString();
var t = "";
for (var e in r)
o.call(r, e) && r[e] && (t = s(t, e));
return t;
if (Array.isArray(t))
return n.apply(this, t);
if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
return t.toString();
var r = "";
for (var e in t)
o.call(t, e) && t[e] && (r = s(r, this && this[e] || e));
return r;
}
function s(r, t) {
return t ? r ? r + " " + t : r + t : r;
function s(t, r) {
return r ? t ? t + " " + r : t + r : t;
}
u.exports ? (n.default = n, u.exports = n) : window.classNames = n;
})();
})(j);
var B = j.exports;
const C = /* @__PURE__ */ D(B), i = {
})(h);
var B = h.exports;
const C = /* @__PURE__ */ D(B), I = {
"purpur-button": "_purpur-button_u2yv5_1",

@@ -163,3 +163,3 @@ "purpur-button--sm": "_purpur-button--sm_u2yv5_33",

"purpur-button--text": "_purpur-button--text_u2yv5_175"
}, I = {
}, V = {
...N,

@@ -169,3 +169,3 @@ DESTRUCTIVE: "destructive",

TEXT: "text"
}, U = Object.values(I), _ = "purpur-button", V = ({
}, F = Object.values(V), X = C.bind(I), i = "purpur-button", L = ({
children: u,

@@ -176,29 +176,29 @@ className: o,

fullWidth: s = !1,
iconOnly: r,
loading: t = !1,
iconOnly: t,
loading: r = !1,
negative: e = !1,
onClick: d,
size: b = x.MD,
variant: v,
type: S = "button",
...f
}, h) => {
if (r && v === "destructive")
size: v = x.MD,
variant: l,
type: j = "button",
...b
}, S) => {
if (t && l === "destructive")
return null;
const $ = C(
const $ = X(
[
i[_],
i[`${_}--${e ? `${v}-negative` : v}`],
i[`${_}--${b}`]
i,
`${i}--${e ? `${l}-negative` : l}`,
`${i}--${v}`
],
{
[i[`${_}--icon-only`]]: r,
[i[`${_}--negative`]]: e,
[i[`${_}--full-width`]]: s,
[i[`${_}--disabled`]]: p || t
[`${i}--icon-only`]: t,
[`${i}--negative`]: e,
[`${i}--full-width`]: s,
[`${i}--disabled`]: p || r
},
o
), z = (y) => {
p || t ? y.preventDefault() : d && d(y);
};
p || r ? y.preventDefault() : d && d(y);
}, f = !!b["aria-disabled"] || p || r;
return /* @__PURE__ */ w(

@@ -209,9 +209,9 @@ "button",

"data-testid": n,
type: S,
ref: h,
"aria-disabled": f["aria-disabled"] || p || t,
type: j,
ref: S,
"aria-disabled": f,
onClick: z,
...f,
...b,
children: [
t && /* @__PURE__ */ l(P, { size: b === x.LG ? "xs" : "xxs", negative: e, disabled: p }),
r && /* @__PURE__ */ c(P, { size: v === x.LG ? "xs" : "xxs", negative: e, disabled: f }),
" ",

@@ -222,9 +222,9 @@ u

);
}, X = E(V);
X.displayName = "Button";
}, G = E(L);
G.displayName = "Button";
export {
I as BUTTON_VARIANT,
X as Button,
U as buttonVariants
V as BUTTON_VARIANT,
G as Button,
F as buttonVariants
};
//# sourceMappingURL=button.es.js.map
Name: @purpurds/action
Version: 5.4.3
Version: 5.5.0
License: AGPL-3.0-only

@@ -9,3 +9,3 @@ Private: false

Name: @purpurds/spinner
Version: 5.4.3
Version: 5.5.0
License: AGPL-3.0-only

@@ -12,0 +12,0 @@ Private: false

{
"name": "@purpurds/button",
"version": "5.5.0",
"version": "5.6.0",
"license": "AGPL-3.0-only",

@@ -18,6 +18,6 @@ "main": "./dist/button.cjs.js",

"classnames": "~2.5.0",
"@purpurds/icon": "5.5.0",
"@purpurds/action": "5.5.0",
"@purpurds/tokens": "5.5.0",
"@purpurds/spinner": "5.5.0"
"@purpurds/action": "5.6.0",
"@purpurds/tokens": "5.6.0",
"@purpurds/icon": "5.6.0",
"@purpurds/spinner": "5.6.0"
},

@@ -46,3 +46,3 @@ "devDependencies": {

"vitest": "~1.5.0",
"@purpurds/icon": "5.5.0",
"@purpurds/icon": "5.6.0",
"@purpurds/component-rig": "1.0.0"

@@ -49,0 +49,0 @@ },

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