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
77
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 4.4.0 to 4.5.0

4

dist/button.cjs.js

@@ -5,7 +5,7 @@ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const _=require("react/jsx-runtime"),h=require("react"),V={PRIMARY:"primary",PRIMARY_NEGATIVE:"primary-negative",SECONDARY:"secondary",SECONDARY_NEGATIVE:"secondary-negative",EXPRESSIVE:"expressive",EXPRESSIVE_NEGATIVE:"expressive-negative"},g={SM:"sm",MD:"md",LG:"lg"};function j(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var m={exports:{}};/*!

http://jedwatson.github.io/classnames
*/(function(e){(function(){var s={}.hasOwnProperty;function u(){for(var t="",r=0;r<arguments.length;r++){var n=arguments[r];n&&(t=i(t,p(n)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return u.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var n in t)s.call(t,n)&&t[n]&&(r=i(r,n));return r}function i(t,r){return r?t?t+" "+r:t+r:t}e.exports?(u.default=u,e.exports=u):window.classNames=u})()})(m);var P=m.exports;const y=j(P),O="_rotate_7s2g1_1",D="_dash_7s2g1_1",l={"purpur-spinner":"_purpur-spinner_7s2g1_1",rotate:O,"purpur-spinner--xxs":"_purpur-spinner--xxs_7s2g1_4","purpur-spinner--xs":"_purpur-spinner--xs_7s2g1_8","purpur-spinner--sm":"_purpur-spinner--sm_7s2g1_12","purpur-spinner--md":"_purpur-spinner--md_7s2g1_16","purpur-spinner--lg":"_purpur-spinner--lg_7s2g1_20","purpur-spinner__circle":"_purpur-spinner__circle_7s2g1_24",dash:D,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_7s2g1_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_7s2g1_36","purpur-spinner__circle--negative-disabled":"_purpur-spinner__circle--negative-disabled_7s2g1_39"},d="purpur-spinner",M={PRIMARY:"primary",DISABLED:"disabled",NEGATIVE:"negative",NEGATIVE_DISABLED:"negative-disabled"},$={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},w=({["data-testid"]:e,size:s=$.SM,variant:u=M.PRIMARY,...p})=>_.jsx("div",{className:y([l[d],l[`${d}--${s}`]]),"data-testid":e,...p,children:_.jsx("svg",{viewBox:"0 0 50 50",children:_.jsx("circle",{className:y(l[`${d}__circle`],l[`${d}__circle--${u}`]),cx:"25",cy:"25",r:"20"})})});function G(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}};/*!
*/(function(e){(function(){var s={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var u=arguments[r];u&&(t=i(t,p(u)))}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 u in t)s.call(t,u)&&t[u]&&(r=i(r,u));return r}function i(t,r){return r?t?t+" "+r:t+r:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(m);var P=m.exports;const f=j(P),O="_rotate_7s2g1_1",D="_dash_7s2g1_1",l={"purpur-spinner":"_purpur-spinner_7s2g1_1",rotate:O,"purpur-spinner--xxs":"_purpur-spinner--xxs_7s2g1_4","purpur-spinner--xs":"_purpur-spinner--xs_7s2g1_8","purpur-spinner--sm":"_purpur-spinner--sm_7s2g1_12","purpur-spinner--md":"_purpur-spinner--md_7s2g1_16","purpur-spinner--lg":"_purpur-spinner--lg_7s2g1_20","purpur-spinner__circle":"_purpur-spinner__circle_7s2g1_24",dash:D,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_7s2g1_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_7s2g1_36","purpur-spinner__circle--negative-disabled":"_purpur-spinner__circle--negative-disabled_7s2g1_39"},v="purpur-spinner",M={PRIMARY:"primary",DISABLED:"disabled",NEGATIVE:"negative",NEGATIVE_DISABLED:"negative-disabled"},$={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},w=({["data-testid"]:e,size:s=$.SM,variant:n=M.PRIMARY,...p})=>_.jsx("div",{className:f([l[v],l[`${v}--${s}`]]),"data-testid":e,...p,children:_.jsx("svg",{viewBox:"0 0 50 50",children:_.jsx("circle",{className:f(l[`${v}__circle`],l[`${v}__circle--${n}`]),cx:"25",cy:"25",r:"20"})})});function G(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var x={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/(function(e){(function(){var s={}.hasOwnProperty;function u(){for(var t="",r=0;r<arguments.length;r++){var n=arguments[r];n&&(t=i(t,p(n)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return t;if(typeof t!="object")return"";if(Array.isArray(t))return u.apply(null,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var n in t)s.call(t,n)&&t[n]&&(r=i(r,n));return r}function i(t,r){return r?t?t+" "+r:t+r:t}e.exports?(u.default=u,e.exports=u):window.classNames=u})()})(x);var B=x.exports;const Y=G(B),a={"purpur-button":"_purpur-button_1fna2_1","purpur-button--sm":"_purpur-button--sm_1fna2_33","purpur-button--icon-only":"_purpur-button--icon-only_1fna2_36","purpur-button--md":"_purpur-button--md_1fna2_39","purpur-button--lg":"_purpur-button--lg_1fna2_45","purpur-button--full-width":"_purpur-button--full-width_1fna2_51","purpur-button--primary":"_purpur-button--primary_1fna2_54","purpur-button--disabled":"_purpur-button--disabled_1fna2_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1fna2_64","purpur-button--secondary":"_purpur-button--secondary_1fna2_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1fna2_87","purpur-button--expressive":"_purpur-button--expressive_1fna2_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1fna2_108","purpur-button--negative":"_purpur-button--negative_1fna2_120","purpur-button--destructive":"_purpur-button--destructive_1fna2_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1fna2_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1fna2_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1fna2_160","purpur-button--text-negative":"_purpur-button--text-negative_1fna2_175","purpur-button--text":"_purpur-button--text_1fna2_175"},E={...V,DESTRUCTIVE:"destructive",DESTRUCTIVE_NEGATIVE:"destructive-negative",TERTIARY_PURPLE:"tertiary-purple",TERTIARY_PURPLE_NEGATVIE:"tertiary-purple-negative",TEXT:"text",TEXT_NEGATIVE:"text-negative"},C=Object.values(E),o="purpur-button",L=({children:e,className:s,["data-testid"]:u,disabled:p=!1,fullWidth:i=!1,iconOnly:t,loading:r=!1,onClick:n,size:f=g.MD,variant:c,type:T="button",...b},A)=>{if(t&&c==="destructive")return null;const R=Y([a[o],a[`${o}--${c}`],a[`${o}--${f}`]],{[a[`${o}--icon-only`]]:t,[a[`${o}--negative`]]:c.endsWith("negative"),[a[`${o}--full-width`]]:i,[a[`${o}--disabled`]]:p||r},s),I=v=>{p||r?v.preventDefault():n&&n(v)},N=()=>c.endsWith("negative")?"negative-disabled":"disabled";return _.jsxs("button",{className:R,"data-testid":u,type:T,ref:A,"aria-disabled":b["aria-disabled"]||p||r,onClick:I,...b,children:[r&&_.jsx(w,{size:f===g.LG?"xs":"xxs",variant:N()})," ",e]})},S=h.forwardRef(L);S.displayName="Button";exports.BUTTON_VARIANT=E;exports.Button=S;exports.buttonVariants=C;
*/(function(e){(function(){var s={}.hasOwnProperty;function n(){for(var t="",r=0;r<arguments.length;r++){var u=arguments[r];u&&(t=i(t,p(u)))}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 u in t)s.call(t,u)&&t[u]&&(r=i(r,u));return r}function i(t,r){return r?t?t+" "+r:t+r:t}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(x);var B=x.exports;const Y=G(B),o={"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"},E={...V,DESTRUCTIVE:"destructive",DESTRUCTIVE_NEGATIVE:"destructive-negative",TERTIARY_PURPLE:"tertiary-purple",TERTIARY_PURPLE_NEGATVIE:"tertiary-purple-negative",TEXT:"text",TEXT_NEGATIVE:"text-negative"},C=Object.values(E),a="purpur-button",L=({children:e,className:s,["data-testid"]:n,disabled:p=!1,fullWidth:i=!1,iconOnly:t,loading:r=!1,onClick:u,size:d=g.MD,variant:c,type:T="button",...b},A)=>{if(t&&c==="destructive")return null;const R=Y([o[a],o[`${a}--${c}`],o[`${a}--${d}`]],{[o[`${a}--icon-only`]]:t,[o[`${a}--negative`]]:c.endsWith("negative"),[o[`${a}--full-width`]]:i,[o[`${a}--disabled`]]:p||r},s),I=y=>{p||r?y.preventDefault():u&&u(y)},N=()=>c.endsWith("negative")?"negative-disabled":"disabled";return _.jsxs("button",{className:R,"data-testid":n,type:T,ref:A,"aria-disabled":b["aria-disabled"]||p||r,onClick:I,...b,children:[r&&_.jsx(w,{size:d===g.LG?"xs":"xxs",variant:N()})," ",e]})},S=h.forwardRef(L);S.displayName="Button";exports.BUTTON_VARIANT=E;exports.Button=S;exports.buttonVariants=C;
//# sourceMappingURL=button.cjs.js.map

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

import { jsx as f, jsxs as I } from "react/jsx-runtime";
import { jsx as v, jsxs as I } from "react/jsx-runtime";
import { forwardRef as N } from "react";

@@ -10,3 +10,3 @@ const h = {

EXPRESSIVE_NEGATIVE: "expressive-negative"
}, g = {
}, f = {
SM: "sm",

@@ -28,6 +28,6 @@ MD: "md",

var s = {}.hasOwnProperty;
function u() {
function n() {
for (var t = "", r = 0; r < arguments.length; r++) {
var n = arguments[r];
n && (t = i(t, p(n)));
var u = arguments[r];
u && (t = i(t, p(u)));
}

@@ -42,8 +42,8 @@ return t;

if (Array.isArray(t))
return u.apply(null, 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 n in t)
s.call(t, n) && t[n] && (r = i(r, n));
for (var u in t)
s.call(t, u) && t[u] && (r = i(r, u));
return r;

@@ -54,7 +54,7 @@ }

}
e.exports ? (u.default = u, e.exports = u) : window.classNames = u;
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
})();
})(m);
var P = m.exports;
const y = /* @__PURE__ */ V(P), D = "_rotate_7s2g1_1", $ = "_dash_7s2g1_1", c = {
const g = /* @__PURE__ */ V(P), D = "_rotate_7s2g1_1", $ = "_dash_7s2g1_1", c = {
"purpur-spinner": "_purpur-spinner_7s2g1_1",

@@ -86,16 +86,16 @@ rotate: D,

size: s = M.SM,
variant: u = w.PRIMARY,
variant: n = w.PRIMARY,
...p
}) => /* @__PURE__ */ f(
}) => /* @__PURE__ */ v(
"div",
{
className: y([c[l], c[`${l}--${s}`]]),
className: g([c[l], c[`${l}--${s}`]]),
"data-testid": e,
...p,
children: /* @__PURE__ */ f("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ f(
children: /* @__PURE__ */ v("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ v(
"circle",
{
className: y(
className: g(
c[`${l}__circle`],
c[`${l}__circle--${u}`]
c[`${l}__circle--${n}`]
),

@@ -121,6 +121,6 @@ cx: "25",

var s = {}.hasOwnProperty;
function u() {
function n() {
for (var t = "", r = 0; r < arguments.length; r++) {
var n = arguments[r];
n && (t = i(t, p(n)));
var u = arguments[r];
u && (t = i(t, p(u)));
}

@@ -135,8 +135,8 @@ return t;

if (Array.isArray(t))
return u.apply(null, 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 n in t)
s.call(t, n) && t[n] && (r = i(r, n));
for (var u in t)
s.call(t, u) && t[u] && (r = i(r, u));
return r;

@@ -147,27 +147,27 @@ }

}
e.exports ? (u.default = u, e.exports = u) : window.classNames = u;
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
})();
})(E);
var j = E.exports;
const Y = /* @__PURE__ */ G(j), a = {
"purpur-button": "_purpur-button_1fna2_1",
"purpur-button--sm": "_purpur-button--sm_1fna2_33",
"purpur-button--icon-only": "_purpur-button--icon-only_1fna2_36",
"purpur-button--md": "_purpur-button--md_1fna2_39",
"purpur-button--lg": "_purpur-button--lg_1fna2_45",
"purpur-button--full-width": "_purpur-button--full-width_1fna2_51",
"purpur-button--primary": "_purpur-button--primary_1fna2_54",
"purpur-button--disabled": "_purpur-button--disabled_1fna2_58",
"purpur-button--primary-negative": "_purpur-button--primary-negative_1fna2_64",
"purpur-button--secondary": "_purpur-button--secondary_1fna2_76",
"purpur-button--secondary-negative": "_purpur-button--secondary-negative_1fna2_87",
"purpur-button--expressive": "_purpur-button--expressive_1fna2_98",
"purpur-button--expressive-negative": "_purpur-button--expressive-negative_1fna2_108",
"purpur-button--negative": "_purpur-button--negative_1fna2_120",
"purpur-button--destructive": "_purpur-button--destructive_1fna2_127",
"purpur-button--destructive-negative": "_purpur-button--destructive-negative_1fna2_137",
"purpur-button--tertiary-purple": "_purpur-button--tertiary-purple_1fna2_147",
"purpur-button--tertiary-purple-negative": "_purpur-button--tertiary-purple-negative_1fna2_160",
"purpur-button--text-negative": "_purpur-button--text-negative_1fna2_175",
"purpur-button--text": "_purpur-button--text_1fna2_175"
const Y = /* @__PURE__ */ G(j), o = {
"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"
}, B = {

@@ -181,6 +181,6 @@ ...h,

TEXT_NEGATIVE: "text-negative"
}, W = Object.values(B), o = "purpur-button", C = ({
}, W = Object.values(B), a = "purpur-button", C = ({
children: e,
className: s,
["data-testid"]: u,
["data-testid"]: n,
disabled: p = !1,

@@ -190,4 +190,4 @@ fullWidth: i = !1,

loading: r = !1,
onClick: n,
size: d = g.MD,
onClick: u,
size: d = f.MD,
variant: _,

@@ -201,15 +201,15 @@ type: x = "button",

[
a[o],
a[`${o}--${_}`],
a[`${o}--${d}`]
o[a],
o[`${a}--${_}`],
o[`${a}--${d}`]
],
{
[a[`${o}--icon-only`]]: t,
[a[`${o}--negative`]]: _.endsWith("negative"),
[a[`${o}--full-width`]]: i,
[a[`${o}--disabled`]]: p || r
[o[`${a}--icon-only`]]: t,
[o[`${a}--negative`]]: _.endsWith("negative"),
[o[`${a}--full-width`]]: i,
[o[`${a}--disabled`]]: p || r
},
s
), T = (v) => {
p || r ? v.preventDefault() : n && n(v);
), T = (y) => {
p || r ? y.preventDefault() : u && u(y);
}, R = () => _.endsWith("negative") ? "negative-disabled" : "disabled";

@@ -220,3 +220,3 @@ return /* @__PURE__ */ I(

className: A,
"data-testid": u,
"data-testid": n,
type: x,

@@ -228,3 +228,3 @@ ref: S,

children: [
r && /* @__PURE__ */ f(O, { size: d === g.LG ? "xs" : "xxs", variant: R() }),
r && /* @__PURE__ */ v(O, { size: d === f.LG ? "xs" : "xxs", variant: R() }),
" ",

@@ -231,0 +231,0 @@ e

Name: @purpurds/action
Version: 4.3.0
Version: 4.4.0
License: AGPL-3.0-only

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

Name: @purpurds/spinner
Version: 4.3.0
Version: 4.4.0
License: AGPL-3.0-only

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

{
"name": "@purpurds/button",
"version": "4.4.0",
"version": "4.5.0",
"license": "AGPL-3.0-only",

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

"classnames": "~2.5.0",
"@purpurds/action": "4.4.0",
"@purpurds/spinner": "4.4.0",
"@purpurds/icon": "4.4.0",
"@purpurds/tokens": "4.4.0"
"@purpurds/icon": "4.5.0",
"@purpurds/spinner": "4.5.0",
"@purpurds/tokens": "4.5.0",
"@purpurds/action": "4.5.0"
},

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

"@purpurds/component-rig": "1.0.0",
"@purpurds/icon": "4.4.0"
"@purpurds/icon": "4.5.0"
},

@@ -50,0 +50,0 @@ "scripts": {

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