@purpurds/button
Advanced tools
Comparing version 5.1.1 to 5.1.2
@@ -1,10 +0,10 @@ | ||
"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:{}};/*! | ||
"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:{}};/*! | ||
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 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:{}};/*! | ||
*/(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:{}};/*! | ||
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 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; | ||
*/(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; | ||
//# sourceMappingURL=button.cjs.js.map |
@@ -9,9 +9,6 @@ import { ActionProps } from '@purpurds/action'; | ||
readonly PRIMARY: "primary"; | ||
readonly PRIMARY_NEGATIVE: "primary-negative"; | ||
readonly SECONDARY: "secondary"; | ||
readonly SECONDARY_NEGATIVE: "secondary-negative"; | ||
readonly EXPRESSIVE: "expressive"; | ||
readonly EXPRESSIVE_NEGATIVE: "expressive-negative"; | ||
}; | ||
export declare const buttonVariants: ("destructive" | "tertiary-purple" | "text" | "primary" | "primary-negative" | "secondary" | "secondary-negative" | "expressive" | "expressive-negative")[]; | ||
export declare const buttonVariants: ("destructive" | "tertiary-purple" | "text" | "primary" | "secondary" | "expressive")[]; | ||
export type ButtonVariant = (typeof BUTTON_VARIANT)[keyof typeof BUTTON_VARIANT]; | ||
@@ -18,0 +15,0 @@ export type ButtonProps = ActionProps<ButtonVariant> & ButtonHTMLAttributes<HTMLButtonElement> & { |
@@ -1,10 +0,7 @@ | ||
import { jsx as l, jsxs as A } from "react/jsx-runtime"; | ||
import { forwardRef as R } from "react"; | ||
const $ = { | ||
import { jsx as l, jsxs as w } from "react/jsx-runtime"; | ||
import { forwardRef as E } from "react"; | ||
const N = { | ||
PRIMARY: "primary", | ||
PRIMARY_NEGATIVE: "primary-negative", | ||
SECONDARY: "secondary", | ||
SECONDARY_NEGATIVE: "secondary-negative", | ||
EXPRESSIVE: "expressive", | ||
EXPRESSIVE_NEGATIVE: "expressive-negative" | ||
EXPRESSIVE: "expressive" | ||
}, x = { | ||
@@ -15,3 +12,3 @@ SM: "sm", | ||
}; | ||
function z(u) { | ||
function O(u) { | ||
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u; | ||
@@ -55,6 +52,6 @@ } | ||
})(g); | ||
var w = g.exports; | ||
const m = /* @__PURE__ */ z(w), O = "_rotate_1xozj_1", T = "_dash_1xozj_1", a = { | ||
var R = g.exports; | ||
const m = /* @__PURE__ */ O(R), A = "_rotate_1xozj_1", M = "_dash_1xozj_1", a = { | ||
"purpur-spinner": "_purpur-spinner_1xozj_1", | ||
rotate: O, | ||
rotate: A, | ||
"purpur-spinner--xxs": "_purpur-spinner--xxs_1xozj_4", | ||
@@ -66,6 +63,6 @@ "purpur-spinner--xs": "_purpur-spinner--xs_1xozj_8", | ||
"purpur-spinner__circle": "_purpur-spinner__circle_1xozj_24", | ||
dash: T, | ||
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", I = { | ||
}, c = "purpur-spinner", T = { | ||
XXS: "xxs", | ||
@@ -76,7 +73,7 @@ XS: "xs", | ||
LG: "lg" | ||
}, M = ({ | ||
}, P = ({ | ||
["data-testid"]: u, | ||
disabled: o = !1, | ||
negative: n = !1, | ||
size: p = I.SM, | ||
size: p = T.SM, | ||
...s | ||
@@ -103,3 +100,3 @@ }) => /* @__PURE__ */ l( | ||
); | ||
function P(u) { | ||
function D(u) { | ||
return u && u.__esModule && Object.prototype.hasOwnProperty.call(u, "default") ? u.default : u; | ||
@@ -143,4 +140,4 @@ } | ||
})(j); | ||
var V = j.exports; | ||
const D = /* @__PURE__ */ P(V), i = { | ||
var B = j.exports; | ||
const C = /* @__PURE__ */ D(B), i = { | ||
"purpur-button": "_purpur-button_u2yv5_1", | ||
@@ -166,8 +163,8 @@ "purpur-button--sm": "_purpur-button--sm_u2yv5_33", | ||
"purpur-button--text": "_purpur-button--text_u2yv5_175" | ||
}, C = { | ||
...$, | ||
}, I = { | ||
...N, | ||
DESTRUCTIVE: "destructive", | ||
TERTIARY_PURPLE: "tertiary-purple", | ||
TEXT: "text" | ||
}, L = Object.values(C), _ = "purpur-button", G = ({ | ||
}, U = Object.values(I), _ = "purpur-button", V = ({ | ||
children: u, | ||
@@ -182,14 +179,14 @@ className: o, | ||
onClick: d, | ||
size: y = x.MD, | ||
size: b = x.MD, | ||
variant: v, | ||
type: S = "button", | ||
...b | ||
}, E) => { | ||
...f | ||
}, h) => { | ||
if (r && v === "destructive") | ||
return null; | ||
const h = D( | ||
const $ = C( | ||
[ | ||
i[_], | ||
i[`${_}--${e ? `${v}-negative` : v}`], | ||
i[`${_}--${y}`] | ||
i[`${_}--${b}`] | ||
], | ||
@@ -203,17 +200,17 @@ { | ||
o | ||
), N = (f) => { | ||
p || t ? f.preventDefault() : d && d(f); | ||
), z = (y) => { | ||
p || t ? y.preventDefault() : d && d(y); | ||
}; | ||
return /* @__PURE__ */ A( | ||
return /* @__PURE__ */ w( | ||
"button", | ||
{ | ||
className: h, | ||
className: $, | ||
"data-testid": n, | ||
type: S, | ||
ref: E, | ||
"aria-disabled": b["aria-disabled"] || p || t, | ||
onClick: N, | ||
...b, | ||
ref: h, | ||
"aria-disabled": f["aria-disabled"] || p || t, | ||
onClick: z, | ||
...f, | ||
children: [ | ||
t && /* @__PURE__ */ l(M, { size: y === x.LG ? "xs" : "xxs", negative: e, disabled: p }), | ||
t && /* @__PURE__ */ l(P, { size: b === x.LG ? "xs" : "xxs", negative: e, disabled: p }), | ||
" ", | ||
@@ -224,9 +221,9 @@ u | ||
); | ||
}, X = R(G); | ||
}, X = E(V); | ||
X.displayName = "Button"; | ||
export { | ||
C as BUTTON_VARIANT, | ||
I as BUTTON_VARIANT, | ||
X as Button, | ||
L as buttonVariants | ||
U as buttonVariants | ||
}; | ||
//# sourceMappingURL=button.es.js.map |
Name: @purpurds/action | ||
Version: 5.1.0 | ||
Version: 5.1.1 | ||
License: AGPL-3.0-only | ||
@@ -9,3 +9,3 @@ Private: false | ||
Name: @purpurds/spinner | ||
Version: 5.1.0 | ||
Version: 5.1.1 | ||
License: AGPL-3.0-only | ||
@@ -12,0 +12,0 @@ Private: false |
{ | ||
"name": "@purpurds/button", | ||
"version": "5.1.1", | ||
"version": "5.1.2", | ||
"license": "AGPL-3.0-only", | ||
@@ -18,6 +18,6 @@ "main": "./dist/button.cjs.js", | ||
"classnames": "~2.5.0", | ||
"@purpurds/action": "5.1.1", | ||
"@purpurds/tokens": "5.1.1", | ||
"@purpurds/icon": "5.1.1", | ||
"@purpurds/spinner": "5.1.1" | ||
"@purpurds/tokens": "5.1.2", | ||
"@purpurds/action": "5.1.2", | ||
"@purpurds/icon": "5.1.2", | ||
"@purpurds/spinner": "5.1.2" | ||
}, | ||
@@ -47,3 +47,3 @@ "devDependencies": { | ||
"@purpurds/component-rig": "1.0.0", | ||
"@purpurds/icon": "5.1.1" | ||
"@purpurds/icon": "5.1.2" | ||
}, | ||
@@ -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
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
78
10
24
3
78
60285
522
+ Added@purpurds/action@5.1.2(transitive)
+ Added@purpurds/icon@5.1.2(transitive)
+ Added@purpurds/spinner@5.1.2(transitive)
+ Added@purpurds/tokens@5.1.2(transitive)
- Removed@purpurds/action@5.1.1(transitive)
- Removed@purpurds/icon@5.1.1(transitive)
- Removed@purpurds/spinner@5.1.1(transitive)
- Removed@purpurds/tokens@5.1.1(transitive)
Updated@purpurds/action@5.1.2
Updated@purpurds/icon@5.1.2
Updated@purpurds/spinner@5.1.2
Updated@purpurds/tokens@5.1.2