@purpurds/button
Advanced tools
Comparing version 5.27.3 to 5.27.4
@@ -1,10 +0,10 @@ | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),$=require("react"),z={PRIMARY:"primary",SECONDARY:"secondary",EXPRESSIVE:"expressive"},E={LG:"lg"};function w(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var m={exports:{}};/*! | ||
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),$=require("react"),z={PRIMARY:"primary",SECONDARY:"secondary",EXPRESSIVE:"expressive"},E={SM:"sm",MD:"md",LG:"lg"};function w(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var m={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})()})(m);var R=m.exports;const y=w(R),A="_rotate_1xozj_1",P="_dash_1xozj_1",a={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:A,"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:P,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},_="purpur-spinner",B={SM:"sm"},V=({["data-testid"]:u,disabled:o=!1,negative:n=!1,size:p=B.SM,...s})=>c.jsx("div",{className:y([a[_],a[`${_}--${p}`]]),"data-testid":u,...s,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:y(a[`${_}__circle`],{[a[`${_}__circle--disabled`]]:o,[a[`${_}__circle--negative`]]:n}),cx:"25",cy:"25",r:"20"})})});function I(u){return u&&u.__esModule&&Object.prototype.hasOwnProperty.call(u,"default")?u.default:u}var g={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})()})(m);var R=m.exports;const y=w(R),A="_rotate_1xozj_1",P="_dash_1xozj_1",a={"purpur-spinner":"_purpur-spinner_1xozj_1",rotate:A,"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:P,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_1xozj_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_1xozj_36"},_="purpur-spinner",B={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},M=({["data-testid"]:u,disabled:o=!1,negative:n=!1,size:p=B.SM,...s})=>c.jsx("div",{className:y([a[_],a[`${_}--${p}`]]),"data-testid":u,...s,children:c.jsx("svg",{viewBox:"0 0 50 50",children:c.jsx("circle",{className:y(a[`${_}__circle`],{[a[`${_}__circle--disabled`]]:o,[a[`${_}__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 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.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})()})(g);var M=g.exports;const U=I(M),C={"purpur-button":"_purpur-button_1acxn_1","purpur-button--sm":"_purpur-button--sm_1acxn_33","purpur-button--icon-only":"_purpur-button--icon-only_1acxn_36","purpur-button--md":"_purpur-button--md_1acxn_39","purpur-button--lg":"_purpur-button--lg_1acxn_45","purpur-button--full-width":"_purpur-button--full-width_1acxn_51","purpur-button--primary":"_purpur-button--primary_1acxn_54","purpur-button--disabled":"_purpur-button--disabled_1acxn_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1acxn_64","purpur-button--secondary":"_purpur-button--secondary_1acxn_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1acxn_87","purpur-button--expressive":"_purpur-button--expressive_1acxn_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1acxn_108","purpur-button--negative":"_purpur-button--negative_1acxn_120","purpur-button--destructive":"_purpur-button--destructive_1acxn_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1acxn_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1acxn_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1acxn_160","purpur-button--text-negative":"_purpur-button--text-negative_1acxn_175","purpur-button--text":"_purpur-button--text_1acxn_175"},j={...z,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},Y=Object.values(j),D=U.bind(C),i="purpur-button",L=["button","submit","reset"],q=({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="md",variant:l,type:S="button",...x},T)=>{if(t&&l==="destructive")return null;const N=D([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=v=>{p||r?v.preventDefault():d&&d(v)},f=!!x["aria-disabled"]||p||r;return c.jsxs("button",{className:N,"data-testid":n,type:S,ref:T,"aria-disabled":f,onClick:O,...x,children:[r&&c.jsx(V,{size:b===E.LG?"xs":"xxs",negative:e,disabled:f})," ",u]})},h=$.forwardRef(q);h.displayName="Button";exports.BUTTON_TYPES=L;exports.BUTTON_VARIANT=j;exports.Button=h;exports.buttonVariants=Y; | ||
*/(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})()})(g);var D=g.exports;const I=V(D),U={"purpur-button":"_purpur-button_1acxn_1","purpur-button--sm":"_purpur-button--sm_1acxn_33","purpur-button--icon-only":"_purpur-button--icon-only_1acxn_36","purpur-button--md":"_purpur-button--md_1acxn_39","purpur-button--lg":"_purpur-button--lg_1acxn_45","purpur-button--full-width":"_purpur-button--full-width_1acxn_51","purpur-button--primary":"_purpur-button--primary_1acxn_54","purpur-button--disabled":"_purpur-button--disabled_1acxn_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1acxn_64","purpur-button--secondary":"_purpur-button--secondary_1acxn_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1acxn_87","purpur-button--expressive":"_purpur-button--expressive_1acxn_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1acxn_108","purpur-button--negative":"_purpur-button--negative_1acxn_120","purpur-button--destructive":"_purpur-button--destructive_1acxn_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1acxn_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1acxn_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1acxn_160","purpur-button--text-negative":"_purpur-button--text-negative_1acxn_175","purpur-button--text":"_purpur-button--text_1acxn_175"},j={...z,DESTRUCTIVE:"destructive",TERTIARY_PURPLE:"tertiary-purple",TEXT:"text"},C=Object.values(j),X=I.bind(U),i="purpur-button",Y=["button","submit","reset"],L=({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="md",variant:l,type:h="button",...x},T)=>{if(t&&l==="destructive")return null;const N=X([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=v=>{p||r?v.preventDefault():d&&d(v)},f=!!x["aria-disabled"]||p||r;return c.jsxs("button",{className:N,"data-testid":n,type:h,ref:T,"aria-disabled":f,onClick:O,...x,children:[r&&c.jsx(M,{size:b===E.LG?"xs":"xxs",negative:e,disabled:f})," ",u]})},S=$.forwardRef(L);S.displayName="Button";exports.BUTTON_TYPES=Y;exports.BUTTON_VARIANT=j;exports.Button=S;exports.buttonVariants=C; | ||
//# sourceMappingURL=button.cjs.js.map |
@@ -8,2 +8,4 @@ import { jsx as c, jsxs as z } from "react/jsx-runtime"; | ||
}, N = { | ||
SM: "sm", | ||
MD: "md", | ||
LG: "lg" | ||
@@ -14,3 +16,3 @@ }; | ||
} | ||
var m = { exports: {} }; | ||
var y = { exports: {} }; | ||
/*! | ||
@@ -23,7 +25,7 @@ Copyright (c) 2018 Jed Watson. | ||
(function() { | ||
var s = {}.hasOwnProperty; | ||
var o = {}.hasOwnProperty; | ||
function n() { | ||
for (var t = "", r = 0; r < arguments.length; r++) { | ||
var e = arguments[r]; | ||
e && (t = o(t, p(e))); | ||
e && (t = s(t, p(e))); | ||
} | ||
@@ -43,6 +45,6 @@ return t; | ||
for (var e in t) | ||
s.call(t, e) && t[e] && (r = o(r, e)); | ||
o.call(t, e) && t[e] && (r = s(r, e)); | ||
return r; | ||
} | ||
function o(t, r) { | ||
function s(t, r) { | ||
return r ? t ? t + " " + r : t + r : t; | ||
@@ -52,5 +54,5 @@ } | ||
})(); | ||
})(m); | ||
var T = m.exports; | ||
const y = /* @__PURE__ */ O(T), R = "_rotate_1xozj_1", A = "_dash_1xozj_1", a = { | ||
})(y); | ||
var T = y.exports; | ||
const m = /* @__PURE__ */ O(T), R = "_rotate_1xozj_1", A = "_dash_1xozj_1", a = { | ||
"purpur-spinner": "_purpur-spinner_1xozj_1", | ||
@@ -68,20 +70,24 @@ rotate: R, | ||
}, _ = "purpur-spinner", P = { | ||
SM: "sm" | ||
}, B = ({ | ||
XXS: "xxs", | ||
XS: "xs", | ||
SM: "sm", | ||
MD: "md", | ||
LG: "lg" | ||
}, M = ({ | ||
["data-testid"]: u, | ||
disabled: s = !1, | ||
disabled: o = !1, | ||
negative: n = !1, | ||
size: p = P.SM, | ||
...o | ||
...s | ||
}) => /* @__PURE__ */ c( | ||
"div", | ||
{ | ||
className: y([a[_], a[`${_}--${p}`]]), | ||
className: m([a[_], a[`${_}--${p}`]]), | ||
"data-testid": u, | ||
...o, | ||
...s, | ||
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ c( | ||
"circle", | ||
{ | ||
className: y(a[`${_}__circle`], { | ||
[a[`${_}__circle--disabled`]]: s, | ||
className: m(a[`${_}__circle`], { | ||
[a[`${_}__circle--disabled`]]: o, | ||
[a[`${_}__circle--negative`]]: n | ||
@@ -96,3 +102,3 @@ }), | ||
); | ||
function C(u) { | ||
function B(u) { | ||
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u; | ||
@@ -108,7 +114,7 @@ } | ||
(function() { | ||
var s = {}.hasOwnProperty; | ||
var o = {}.hasOwnProperty; | ||
function n() { | ||
for (var t = "", r = 0; r < arguments.length; r++) { | ||
var e = arguments[r]; | ||
e && (t = o(t, p.call(this, e))); | ||
e && (t = s(t, p.call(this, e))); | ||
} | ||
@@ -128,6 +134,6 @@ return t; | ||
for (var e in t) | ||
s.call(t, e) && t[e] && (r = o(r, this && this[e] || e)); | ||
o.call(t, e) && t[e] && (r = s(r, this && this[e] || e)); | ||
return r; | ||
} | ||
function o(t, r) { | ||
function s(t, r) { | ||
return r ? t ? t + " " + r : t + r : t; | ||
@@ -138,4 +144,4 @@ } | ||
})(g); | ||
var I = g.exports; | ||
const M = /* @__PURE__ */ C(I), V = { | ||
var D = g.exports; | ||
const C = /* @__PURE__ */ B(D), I = { | ||
"purpur-button": "_purpur-button_1acxn_1", | ||
@@ -161,3 +167,3 @@ "purpur-button--sm": "_purpur-button--sm_1acxn_33", | ||
"purpur-button--text": "_purpur-button--text_1acxn_175" | ||
}, D = { | ||
}, V = { | ||
...E, | ||
@@ -167,8 +173,8 @@ DESTRUCTIVE: "destructive", | ||
TEXT: "text" | ||
}, F = Object.values(D), U = M.bind(V), i = "purpur-button", q = ["button", "submit", "reset"], Y = ({ | ||
}, F = Object.values(V), X = C.bind(I), i = "purpur-button", q = ["button", "submit", "reset"], L = ({ | ||
children: u, | ||
className: s, | ||
className: o, | ||
["data-testid"]: n, | ||
disabled: p = !1, | ||
fullWidth: o = !1, | ||
fullWidth: s = !1, | ||
iconOnly: t, | ||
@@ -185,3 +191,3 @@ loading: r = !1, | ||
return null; | ||
const S = U( | ||
const S = X( | ||
[ | ||
@@ -195,6 +201,6 @@ i, | ||
[`${i}--negative`]: e, | ||
[`${i}--full-width`]: o, | ||
[`${i}--full-width`]: s, | ||
[`${i}--disabled`]: p || r | ||
}, | ||
s | ||
o | ||
), $ = (v) => { | ||
@@ -214,3 +220,3 @@ p || r ? v.preventDefault() : d && d(v); | ||
children: [ | ||
r && /* @__PURE__ */ c(B, { size: b === N.LG ? "xs" : "xxs", negative: e, disabled: f }), | ||
r && /* @__PURE__ */ c(M, { size: b === N.LG ? "xs" : "xxs", negative: e, disabled: f }), | ||
" ", | ||
@@ -221,10 +227,10 @@ u | ||
); | ||
}, L = w(Y); | ||
L.displayName = "Button"; | ||
}, U = w(L); | ||
U.displayName = "Button"; | ||
export { | ||
q as BUTTON_TYPES, | ||
D as BUTTON_VARIANT, | ||
L as Button, | ||
V as BUTTON_VARIANT, | ||
U as Button, | ||
F as buttonVariants | ||
}; | ||
//# sourceMappingURL=button.es.js.map |
Name: @purpurds/action | ||
Version: 5.27.2 | ||
Version: 5.27.3 | ||
License: AGPL-3.0-only | ||
@@ -9,3 +9,3 @@ Private: false | ||
Name: @purpurds/spinner | ||
Version: 5.27.2 | ||
Version: 5.27.3 | ||
License: AGPL-3.0-only | ||
@@ -12,0 +12,0 @@ Private: false |
{ | ||
"name": "@purpurds/button", | ||
"version": "5.27.3", | ||
"version": "5.27.4", | ||
"license": "AGPL-3.0-only", | ||
@@ -18,6 +18,6 @@ "main": "./dist/button.cjs.js", | ||
"classnames": "~2.5.0", | ||
"@purpurds/action": "5.27.3", | ||
"@purpurds/spinner": "5.27.3", | ||
"@purpurds/icon": "5.27.3", | ||
"@purpurds/tokens": "5.27.3" | ||
"@purpurds/spinner": "5.27.4", | ||
"@purpurds/icon": "5.27.4", | ||
"@purpurds/tokens": "5.27.4", | ||
"@purpurds/action": "5.27.4" | ||
}, | ||
@@ -47,4 +47,4 @@ "devDependencies": { | ||
"vitest": "^2.1.2", | ||
"@purpurds/component-rig": "1.0.0", | ||
"@purpurds/icon": "5.27.3" | ||
"@purpurds/icon": "5.27.4", | ||
"@purpurds/component-rig": "1.0.0" | ||
}, | ||
@@ -51,0 +51,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
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
61832
544
+ Added@purpurds/action@5.27.4(transitive)
+ Added@purpurds/icon@5.27.4(transitive)
+ Added@purpurds/spinner@5.27.4(transitive)
+ Added@purpurds/tokens@5.27.4(transitive)
- Removed@purpurds/action@5.27.3(transitive)
- Removed@purpurds/icon@5.27.3(transitive)
- Removed@purpurds/spinner@5.27.3(transitive)
- Removed@purpurds/tokens@5.27.3(transitive)
Updated@purpurds/action@5.27.4
Updated@purpurds/icon@5.27.4
Updated@purpurds/spinner@5.27.4
Updated@purpurds/tokens@5.27.4