@purpurds/button
Advanced tools
Comparing version 5.25.0 to 5.25.1-0
@@ -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={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:{}};/*! | ||
"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:{}};/*! | ||
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={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:{}};/*! | ||
*/(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:{}};/*! | ||
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 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; | ||
*/(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; | ||
//# sourceMappingURL=button.cjs.js.map |
@@ -8,4 +8,2 @@ import { jsx as c, jsxs as z } from "react/jsx-runtime"; | ||
}, N = { | ||
SM: "sm", | ||
MD: "md", | ||
LG: "lg" | ||
@@ -16,3 +14,3 @@ }; | ||
} | ||
var y = { exports: {} }; | ||
var m = { exports: {} }; | ||
/*! | ||
@@ -25,7 +23,7 @@ Copyright (c) 2018 Jed Watson. | ||
(function() { | ||
var o = {}.hasOwnProperty; | ||
var s = {}.hasOwnProperty; | ||
function n() { | ||
for (var t = "", r = 0; r < arguments.length; r++) { | ||
var e = arguments[r]; | ||
e && (t = s(t, p(e))); | ||
e && (t = o(t, p(e))); | ||
} | ||
@@ -45,6 +43,6 @@ return t; | ||
for (var e in t) | ||
o.call(t, e) && t[e] && (r = s(r, e)); | ||
s.call(t, e) && t[e] && (r = o(r, e)); | ||
return r; | ||
} | ||
function s(t, r) { | ||
function o(t, r) { | ||
return r ? t ? t + " " + r : t + r : t; | ||
@@ -54,5 +52,5 @@ } | ||
})(); | ||
})(y); | ||
var T = y.exports; | ||
const m = /* @__PURE__ */ O(T), R = "_rotate_1xozj_1", A = "_dash_1xozj_1", a = { | ||
})(m); | ||
var T = m.exports; | ||
const y = /* @__PURE__ */ O(T), R = "_rotate_1xozj_1", A = "_dash_1xozj_1", a = { | ||
"purpur-spinner": "_purpur-spinner_1xozj_1", | ||
@@ -70,24 +68,20 @@ rotate: R, | ||
}, _ = "purpur-spinner", P = { | ||
XXS: "xxs", | ||
XS: "xs", | ||
SM: "sm", | ||
MD: "md", | ||
LG: "lg" | ||
}, M = ({ | ||
SM: "sm" | ||
}, B = ({ | ||
["data-testid"]: u, | ||
disabled: o = !1, | ||
disabled: s = !1, | ||
negative: n = !1, | ||
size: p = P.SM, | ||
...s | ||
...o | ||
}) => /* @__PURE__ */ c( | ||
"div", | ||
{ | ||
className: m([a[_], a[`${_}--${p}`]]), | ||
className: y([a[_], a[`${_}--${p}`]]), | ||
"data-testid": u, | ||
...s, | ||
...o, | ||
children: /* @__PURE__ */ c("svg", { viewBox: "0 0 50 50", children: /* @__PURE__ */ c( | ||
"circle", | ||
{ | ||
className: m(a[`${_}__circle`], { | ||
[a[`${_}__circle--disabled`]]: o, | ||
className: y(a[`${_}__circle`], { | ||
[a[`${_}__circle--disabled`]]: s, | ||
[a[`${_}__circle--negative`]]: n | ||
@@ -102,3 +96,3 @@ }), | ||
); | ||
function B(u) { | ||
function C(u) { | ||
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u; | ||
@@ -114,7 +108,7 @@ } | ||
(function() { | ||
var o = {}.hasOwnProperty; | ||
var s = {}.hasOwnProperty; | ||
function n() { | ||
for (var t = "", r = 0; r < arguments.length; r++) { | ||
var e = arguments[r]; | ||
e && (t = s(t, p.call(this, e))); | ||
e && (t = o(t, p.call(this, e))); | ||
} | ||
@@ -134,6 +128,6 @@ return t; | ||
for (var e in t) | ||
o.call(t, e) && t[e] && (r = s(r, this && this[e] || e)); | ||
s.call(t, e) && t[e] && (r = o(r, this && this[e] || e)); | ||
return r; | ||
} | ||
function s(t, r) { | ||
function o(t, r) { | ||
return r ? t ? t + " " + r : t + r : t; | ||
@@ -144,4 +138,4 @@ } | ||
})(g); | ||
var D = g.exports; | ||
const C = /* @__PURE__ */ B(D), I = { | ||
var I = g.exports; | ||
const M = /* @__PURE__ */ C(I), V = { | ||
"purpur-button": "_purpur-button_1acxn_1", | ||
@@ -167,3 +161,3 @@ "purpur-button--sm": "_purpur-button--sm_1acxn_33", | ||
"purpur-button--text": "_purpur-button--text_1acxn_175" | ||
}, V = { | ||
}, D = { | ||
...E, | ||
@@ -173,8 +167,8 @@ DESTRUCTIVE: "destructive", | ||
TEXT: "text" | ||
}, F = Object.values(V), X = C.bind(I), i = "purpur-button", q = ["button", "submit", "reset"], L = ({ | ||
}, F = Object.values(D), U = M.bind(V), i = "purpur-button", q = ["button", "submit", "reset"], Y = ({ | ||
children: u, | ||
className: o, | ||
className: s, | ||
["data-testid"]: n, | ||
disabled: p = !1, | ||
fullWidth: s = !1, | ||
fullWidth: o = !1, | ||
iconOnly: t, | ||
@@ -191,3 +185,3 @@ loading: r = !1, | ||
return null; | ||
const S = X( | ||
const S = U( | ||
[ | ||
@@ -201,6 +195,6 @@ i, | ||
[`${i}--negative`]: e, | ||
[`${i}--full-width`]: s, | ||
[`${i}--full-width`]: o, | ||
[`${i}--disabled`]: p || r | ||
}, | ||
o | ||
s | ||
), $ = (v) => { | ||
@@ -220,3 +214,3 @@ p || r ? v.preventDefault() : d && d(v); | ||
children: [ | ||
r && /* @__PURE__ */ c(M, { size: b === N.LG ? "xs" : "xxs", negative: e, disabled: f }), | ||
r && /* @__PURE__ */ c(B, { size: b === N.LG ? "xs" : "xxs", negative: e, disabled: f }), | ||
" ", | ||
@@ -227,10 +221,10 @@ u | ||
); | ||
}, U = w(L); | ||
U.displayName = "Button"; | ||
}, L = w(Y); | ||
L.displayName = "Button"; | ||
export { | ||
q as BUTTON_TYPES, | ||
V as BUTTON_VARIANT, | ||
U as Button, | ||
D as BUTTON_VARIANT, | ||
L as Button, | ||
F as buttonVariants | ||
}; | ||
//# sourceMappingURL=button.es.js.map |
Name: @purpurds/action | ||
Version: 5.24.3 | ||
Version: 5.25.0 | ||
License: AGPL-3.0-only | ||
@@ -9,3 +9,3 @@ Private: false | ||
Name: @purpurds/spinner | ||
Version: 5.24.3 | ||
Version: 5.25.0 | ||
License: AGPL-3.0-only | ||
@@ -12,0 +12,0 @@ Private: false |
{ | ||
"name": "@purpurds/button", | ||
"version": "5.25.0", | ||
"version": "5.25.1-0", | ||
"license": "AGPL-3.0-only", | ||
@@ -18,6 +18,6 @@ "main": "./dist/button.cjs.js", | ||
"classnames": "~2.5.0", | ||
"@purpurds/action": "5.25.0", | ||
"@purpurds/icon": "5.25.0", | ||
"@purpurds/tokens": "5.25.0", | ||
"@purpurds/spinner": "5.25.0" | ||
"@purpurds/action": "5.25.1-0", | ||
"@purpurds/spinner": "5.25.1-0", | ||
"@purpurds/icon": "5.25.1-0", | ||
"@purpurds/tokens": "5.25.1-0" | ||
}, | ||
@@ -47,4 +47,4 @@ "devDependencies": { | ||
"vitest": "^2.1.2", | ||
"@purpurds/component-rig": "1.0.0", | ||
"@purpurds/icon": "5.25.0" | ||
"@purpurds/icon": "5.25.1-0", | ||
"@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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
61483
534
3
+ Added@purpurds/action@5.25.1-0(transitive)
+ Added@purpurds/icon@5.25.1-0(transitive)
+ Added@purpurds/spinner@5.25.1-0(transitive)
+ Added@purpurds/tokens@5.25.1-0(transitive)
- Removed@purpurds/action@5.25.0(transitive)
- Removed@purpurds/icon@5.25.0(transitive)
- Removed@purpurds/spinner@5.25.0(transitive)
- Removed@purpurds/tokens@5.25.0(transitive)
Updated@purpurds/action@5.25.1-0
Updated@purpurds/icon@5.25.1-0
Updated@purpurds/spinner@5.25.1-0
Updated@purpurds/tokens@5.25.1-0