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
80
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.6.0 to 5.0.0

6

dist/button.cjs.js

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

"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:{}};/*!
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),T=require("react"),O={PRIMARY:"primary",PRIMARY_NEGATIVE:"primary-negative",SECONDARY:"secondary",SECONDARY_NEGATIVE:"secondary-negative",EXPRESSIVE:"expressive",EXPRESSIVE_NEGATIVE:"expressive-negative"},x={SM:"sm",MD:"md",LG:"lg"};function $(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(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:{}};/*!
*/(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 z=g.exports;const m=$(z),w="_rotate_1xozj_1",I="_dash_1xozj_1",_={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:w,"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:I,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},c="purpur-spinner",M={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},P=({["data-testid"]:u,disabled:o=!1,negative:n=!1,size:p=M.SM,...s})=>l.jsx("div",{className:m([_[c],_[`${c}--${p}`]]),"data-testid":u,...s,children:l.jsx("svg",{viewBox:"0 0 50 50",children:l.jsx("circle",{className:m(_[`${c}__circle`],{[_[`${c}__circle--disabled`]]:o,[_[`${c}__circle--negative`]]:n}),cx:"25",cy:"25",r:"20"})})});function V(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(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;
*/(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 D=j.exports;const B=V(D),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={...O,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},C=Object.values(S),a="purpur-button",G=({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:N="button",...y},h)=>{if(t&&v==="destructive")return null;const A=B([i[a],i[`${a}--${e?`${v}-negative`:v}`],i[`${a}--${b}`]],{[i[`${a}--icon-only`]]:t,[i[`${a}--negative`]]:e,[i[`${a}--full-width`]]:s,[i[`${a}--disabled`]]:p||r},o),R=f=>{p||r?f.preventDefault():d&&d(f)};return l.jsxs("button",{className:A,"data-testid":n,type:N,ref:h,"aria-disabled":y["aria-disabled"]||p||r,onClick:R,...y,children:[r&&l.jsx(P,{size:b===x.LG?"xs":"xxs",negative:e,disabled:p})," ",u]})},E=T.forwardRef(G);E.displayName="Button";exports.BUTTON_VARIANT=S;exports.Button=E;exports.buttonVariants=C;
//# sourceMappingURL=button.cjs.js.map

@@ -6,7 +6,4 @@ import { ActionProps } from '@purpurds/action';

readonly DESTRUCTIVE: "destructive";
readonly DESTRUCTIVE_NEGATIVE: "destructive-negative";
readonly TERTIARY_PURPLE: "tertiary-purple";
readonly TERTIARY_PURPLE_NEGATVIE: "tertiary-purple-negative";
readonly TEXT: "text";
readonly TEXT_NEGATIVE: "text-negative";
readonly PRIMARY: "primary";

@@ -19,3 +16,3 @@ readonly PRIMARY_NEGATIVE: "primary-negative";

};
export declare const buttonVariants: ("destructive" | "destructive-negative" | "tertiary-purple" | "tertiary-purple-negative" | "text" | "text-negative" | "primary" | "primary-negative" | "secondary" | "secondary-negative" | "expressive" | "expressive-negative")[];
export declare const buttonVariants: ("destructive" | "tertiary-purple" | "text" | "primary" | "primary-negative" | "secondary" | "secondary-negative" | "expressive" | "expressive-negative")[];
export type ButtonVariant = (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT];

@@ -22,0 +19,0 @@ export type ButtonProps = ActionProps<ButtonVariant> & ButtonHTMLAttributes<HTMLButtonElement> & {

@@ -1,4 +0,4 @@

import { jsx as v, jsxs as I } from "react/jsx-runtime";
import { forwardRef as N } from "react";
const h = {
import { jsx as l, jsxs as A } from "react/jsx-runtime";
import { forwardRef as R } from "react";
const $ = {
PRIMARY: "primary",

@@ -10,3 +10,3 @@ PRIMARY_NEGATIVE: "primary-negative",

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

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

};
function V(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
function z(u) {
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
}
var m = { exports: {} };
var g = { exports: {} };
/*!

@@ -26,52 +26,46 @@ Copyright (c) 2018 Jed Watson.

*/
(function(e) {
(function(u) {
(function() {
var s = {}.hasOwnProperty;
var o = {}.hasOwnProperty;
function n() {
for (var t = "", r = 0; r < arguments.length; r++) {
var u = arguments[r];
u && (t = i(t, p(u)));
for (var r = "", t = 0; t < arguments.length; t++) {
var e = arguments[t];
e && (r = s(r, p(e)));
}
return t;
return r;
}
function p(t) {
if (typeof t == "string" || typeof t == "number")
return t;
if (typeof t != "object")
function p(r) {
if (typeof r == "string" || typeof r == "number")
return r;
if (typeof r != "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;
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;
}
function i(t, r) {
return r ? t ? t + " " + r : t + r : t;
function s(r, t) {
return t ? r ? r + " " + t : r + t : r;
}
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
u.exports ? (n.default = n, u.exports = n) : window.classNames = n;
})();
})(m);
var P = m.exports;
const g = /* @__PURE__ */ V(P), D = "_rotate_7s2g1_1", $ = "_dash_7s2g1_1", c = {
"purpur-spinner": "_purpur-spinner_7s2g1_1",
rotate: D,
"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: $,
"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"
}, l = "purpur-spinner", w = {
PRIMARY: "primary",
DISABLED: "disabled",
NEGATIVE: "negative",
NEGATIVE_DISABLED: "negative-disabled"
}, M = {
})(g);
var w = g.exports;
const m = /* @__PURE__ */ z(w), O = "_rotate_1xozj_1", T = "_dash_1xozj_1", a = {
"purpur-spinner": "_purpur-spinner_1xozj_1",
rotate: O,
"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: T,
"purpur-spinner__circle--disabled": "_purpur-spinner__circle--disabled_1xozj_33",
"purpur-spinner__circle--negative": "_purpur-spinner__circle--negative_1xozj_36"
}, c = "purpur-spinner", I = {
XXS: "xxs",

@@ -82,20 +76,21 @@ XS: "xs",

LG: "lg"
}, O = ({
["data-testid"]: e,
size: s = M.SM,
variant: n = w.PRIMARY,
...p
}) => /* @__PURE__ */ v(
}, M = ({
["data-testid"]: u,
disabled: o = !1,
negative: n = !1,
size: p = I.SM,
...s
}) => /* @__PURE__ */ l(
"div",
{
className: g([c[l], c[`${l}--${s}`]]),
"data-testid": e,
...p,
children: /* @__PURE__ */ v("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ v(
className: m([a[c], a[`${c}--${p}`]]),
"data-testid": u,
...s,
children: /* @__PURE__ */ l("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ l(
"circle",
{
className: g(
c[`${l}__circle`],
c[`${l}__circle--${n}`]
),
className: m(a[`${c}__circle`], {
[a[`${c}__circle--disabled`]]: o,
[a[`${c}__circle--negative`]]: n
}),
cx: "25",

@@ -108,6 +103,6 @@ cy: "25",

);
function G(e) {
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
function P(u) {
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u;
}
var E = { exports: {} };
var j = { exports: {} };
/*!

@@ -118,34 +113,34 @@ Copyright (c) 2018 Jed Watson.

*/
(function(e) {
(function(u) {
(function() {
var s = {}.hasOwnProperty;
var o = {}.hasOwnProperty;
function n() {
for (var t = "", r = 0; r < arguments.length; r++) {
var u = arguments[r];
u && (t = i(t, p(u)));
for (var r = "", t = 0; t < arguments.length; t++) {
var e = arguments[t];
e && (r = s(r, p(e)));
}
return t;
return r;
}
function p(t) {
if (typeof t == "string" || typeof t == "number")
return t;
if (typeof t != "object")
function p(r) {
if (typeof r == "string" || typeof r == "number")
return r;
if (typeof r != "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;
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;
}
function i(t, r) {
return r ? t ? t + " " + r : t + r : t;
function s(r, t) {
return t ? r ? r + " " + t : r + t : r;
}
e.exports ? (n.default = n, e.exports = n) : window.classNames = n;
u.exports ? (n.default = n, u.exports = n) : window.classNames = n;
})();
})(E);
var j = E.exports;
const Y = /* @__PURE__ */ G(j), o = {
})(j);
var V = j.exports;
const D = /* @__PURE__ */ P(V), i = {
"purpur-button": "_purpur-button_u2yv5_1",

@@ -171,66 +166,64 @@ "purpur-button--sm": "_purpur-button--sm_u2yv5_33",

"purpur-button--text": "_purpur-button--text_u2yv5_175"
}, B = {
...h,
}, C = {
...$,
DESTRUCTIVE: "destructive",
DESTRUCTIVE_NEGATIVE: "destructive-negative",
TERTIARY_PURPLE: "tertiary-purple",
TERTIARY_PURPLE_NEGATVIE: "tertiary-purple-negative",
TEXT: "text",
TEXT_NEGATIVE: "text-negative"
}, W = Object.values(B), a = "purpur-button", C = ({
children: e,
className: s,
TEXT: "text"
}, L = Object.values(C), _ = "purpur-button", G = ({
children: u,
className: o,
["data-testid"]: n,
disabled: p = !1,
fullWidth: i = !1,
iconOnly: t,
loading: r = !1,
onClick: u,
size: d = f.MD,
variant: _,
type: x = "button",
fullWidth: s = !1,
iconOnly: r,
loading: t = !1,
negative: e = !1,
onClick: d,
size: y = x.MD,
variant: v,
type: S = "button",
...b
}, S) => {
if (t && _ === "destructive")
}, E) => {
if (r && v === "destructive")
return null;
const A = Y(
const h = D(
[
o[a],
o[`${a}--${_}`],
o[`${a}--${d}`]
i[_],
i[`${_}--${e ? `${v}-negative` : v}`],
i[`${_}--${y}`]
],
{
[o[`${a}--icon-only`]]: t,
[o[`${a}--negative`]]: _.endsWith("negative"),
[o[`${a}--full-width`]]: i,
[o[`${a}--disabled`]]: p || r
[i[`${_}--icon-only`]]: r,
[i[`${_}--negative`]]: e,
[i[`${_}--full-width`]]: s,
[i[`${_}--disabled`]]: p || t
},
s
), T = (y) => {
p || r ? y.preventDefault() : u && u(y);
}, R = () => _.endsWith("negative") ? "negative-disabled" : "disabled";
return /* @__PURE__ */ I(
o
), N = (f) => {
p || t ? f.preventDefault() : d && d(f);
};
return /* @__PURE__ */ A(
"button",
{
className: A,
className: h,
"data-testid": n,
type: x,
ref: S,
"aria-disabled": b["aria-disabled"] || p || r,
onClick: T,
type: S,
ref: E,
"aria-disabled": b["aria-disabled"] || p || t,
onClick: N,
...b,
children: [
r && /* @__PURE__ */ v(O, { size: d === f.LG ? "xs" : "xxs", variant: R() }),
t && /* @__PURE__ */ l(M, { size: y === x.LG ? "xs" : "xxs", negative: e, disabled: p }),
" ",
e
u
]
}
);
}, L = N(C);
L.displayName = "Button";
}, X = R(G);
X.displayName = "Button";
export {
B as BUTTON_VARIANT,
L as Button,
W as buttonVariants
C as BUTTON_VARIANT,
X as Button,
L as buttonVariants
};
//# sourceMappingURL=button.es.js.map
Name: @purpurds/action
Version: 4.5.1
Version: 4.6.0
License: AGPL-3.0-only

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

Name: @purpurds/spinner
Version: 4.5.1
Version: 4.6.0
License: AGPL-3.0-only

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

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

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

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

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

"@purpurds/component-rig": "1.0.0",
"@purpurds/icon": "4.6.0"
"@purpurds/icon": "5.0.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