@purpurds/badge 5.35.0 → 6.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/LICENSE.txt +1 -1
- package/dist/badge.cjs.js +3 -3
- package/dist/badge.cjs.js.map +1 -1
- package/dist/badge.d.ts.map +1 -1
- package/dist/badge.es.js +68 -67
- package/dist/badge.es.js.map +1 -1
- package/package.json +3 -3
- package/src/badge.stories.tsx +1 -1
- package/src/badge.test.tsx +2 -1
- package/src/badge.tsx +8 -1
package/dist/LICENSE.txt
CHANGED
package/dist/badge.cjs.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime");function h(
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime");function h(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var v={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/(function(
|
|
5
|
+
*/(function(r){(function(){var s={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,u.call(this,n)))}return e}function u(e){if(typeof e=="string"||typeof e=="number")return this&&this[e]||e;if(typeof e!="object")return"";if(Array.isArray(e))return a.apply(this,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)s.call(e,n)&&e[n]&&(t=o(t,this&&this[n]||n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}r.exports?(a.default=a,r.exports=a):window.classNames=a})()})(v);var _=v.exports;const w=h(_),y={"purpur-icon":"_purpur-icon_8u1lq_1","purpur-icon--xxs":"_purpur-icon--xxs_8u1lq_4","purpur-icon--xs":"_purpur-icon--xs_8u1lq_8","purpur-icon--sm":"_purpur-icon--sm_8u1lq_12","purpur-icon--md":"_purpur-icon--md_8u1lq_16","purpur-icon--lg":"_purpur-icon--lg_8u1lq_20","purpur-icon--xl":"_purpur-icon--xl_8u1lq_24"},b=w.bind(y),i="purpur-icon",x="md",Z=r=>r.filter(s=>Object.keys(s).length>=1).map(s=>`${s.name}="${s.value}"`).join(" "),A=({content:r="",title:s}={})=>{const a=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},s?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],u=s?`<title>${s}</title>`:"";return`<svg ${Z(a)}>${u}${r}</svg>`},S=r=>r.replace(/<(\/?)svg([^>]*)>/g,"").trim(),g=({["data-testid"]:r,svg:s,allyTitle:a,className:u,size:o=x,...e})=>{const t=A({content:S(s.svg),title:a}),n=b(u,i,`${i}--${o}`);return c.jsx("span",{"aria-label":a,className:n,"data-testid":r,dangerouslySetInnerHTML:{__html:t},...e})};g.displayName="Icon";const N={name:"alert",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="m13.038 7.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.586 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.664 0 1.25.601 1.25 1.234Z"/><path fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.75 0a8.25 8.25 0 1 1-16.5 0 8.25 8.25 0 0 1 16.5 0Z" clip-rule="evenodd"/></svg>',keywords:["alert"],category:"status"},M={name:"check-circle",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M16.487 9.514a.872.872 0 1 0-1.42-1.014l-4.248 5.948-2.18-2.18a.872.872 0 0 0-1.233 1.234l2.908 2.908a.872.872 0 0 0 1.326-.11l4.847-6.786Z"/><path fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.75 0a8.25 8.25 0 1 1-16.5 0 8.25 8.25 0 0 1 16.5 0Z" clip-rule="evenodd"/></svg>',keywords:["check-circle"],category:"status"},O={name:"error",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M10.354 3.05c.732-1.267 2.56-1.267 3.291 0l8.66 15c.732 1.267-.182 2.85-1.645 2.85H3.34c-1.463 0-2.377-1.583-1.646-2.85l8.66-15Zm1.595.862a.092.092 0 0 0-.036.038l-8.66 15a.092.092 0 0 0-.015.05c0 .014.005.032.015.05a.11.11 0 0 0 .036.038.09.09 0 0 0 .05.012H20.66a.088.088 0 0 0 .05-.012.106.106 0 0 0 .037-.038.105.105 0 0 0 .015-.05.092.092 0 0 0-.015-.05l-8.66-15a.092.092 0 0 0-.036-.038A.106.106 0 0 0 12 3.9a.105.105 0 0 0-.05.012Z" clip-rule="evenodd"/><path d="m12.523 14.922.412-6.25a.936.936 0 1 0-1.868 0l.421 6.25h1.035ZM12 17.52c.44 0 .826-.387.826-.815 0-.418-.387-.816-.826-.816-.428 0-.825.398-.825.816 0 .428.397.815.825.815Z"/><path fill-rule="evenodd" d="M12.691 15.096h-1.37l-.431-6.53a1 1 0 0 1 .997-1.066h.227a1 1 0 0 1 .998 1.064l-.42 6.532Zm.244-6.425a.936.936 0 1 0-1.868.002l.421 6.249h1.035l.412-6.25ZM13 16.706c0 .526-.466.99-1 .99-.522 0-1-.463-1-.99 0-.264.125-.51.304-.689.18-.178.429-.301.696-.301.536 0 1 .475 1 .99Zm-.174 0c0 .428-.387.815-.826.815-.428 0-.825-.387-.825-.815 0-.418.397-.816.825-.816.44 0 .826.398.826.816Z" clip-rule="evenodd"/></svg>',keywords:["error"],category:"status"},C={name:"info",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M11 8.18c0 .537.469.979 1.007.979.524 0 .993-.442.993-.98s-.469-.979-.993-.979c-.538 0-1.007.441-1.007.98Zm.152 1.958v6.897h1.696v-6.897h-1.696Z"/><path fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.75 0a8.25 8.25 0 1 1-16.5 0 8.25 8.25 0 0 1 16.5 0Z" clip-rule="evenodd"/></svg>',keywords:["info"],category:"status"},I={name:"offering",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M7.118 4.6H7a1.9 1.9 0 0 0-1.9 1.9V8a1.9 1.9 0 0 0 1.5 1.858v.642a.9.9 0 1 0 1.8 0v-.6h3.2v.6a.9.9 0 0 0 1.8 0v-.6h3.7V11a.9.9 0 0 0 1.8 0V9.858A1.9 1.9 0 0 0 20.4 8V6.5a1.9 1.9 0 0 0-1.9-1.9h-.618c-.063-.708-.3-1.394-.756-1.943-.56-.674-1.384-1.057-2.376-1.057-.92 0-1.696.33-2.25.915-.554-.585-1.33-.915-2.25-.915-.992 0-1.816.383-2.376 1.057-.457.549-.693 1.235-.756 1.943Zm1.812 0h2.64c-.053-.34-.174-.607-.328-.792-.192-.232-.493-.408-.992-.408s-.8.176-.992.408c-.154.185-.275.452-.328.792Zm4.5 0h2.64c-.053-.34-.174-.607-.328-.792-.192-.232-.493-.408-.992-.408s-.8.176-.992.408c-.154.185-.275.452-.328.792Zm-.03 3.5h5.1a.1.1 0 0 0 .1-.1V6.5a.1.1 0 0 0-.1-.1h-5.1v1.7Zm-1.8-1.7H7a.1.1 0 0 0-.1.1V8a.1.1 0 0 0 .1.1h4.6V6.4Zm8.335 5.147c.743-.107 1.52.135 2.201.817.474.473.695 1.011.708 1.548.012.508-.163.927-.318 1.2-.185.326-.47.607-.634.77l-.049.047-4.414 4.414a1.9 1.9 0 0 1-1.343.557H7.914a.1.1 0 0 0-.07.03l-.5.5a1.9 1.9 0 0 1-2.687 0L2.57 19.342a1.9 1.9 0 0 1 0-2.686l4-4a1.9 1.9 0 0 1 1.343-.557H14.5v.9-.9h.041l.065.004a2.73 2.73 0 0 1 .79.185 2.665 2.665 0 0 1 1.46 1.417c.188-.162.375-.324.551-.479.46-.401.815-.722.957-.863.338-.34.882-.719 1.571-.817ZM15.088 15.1a1.06 1.06 0 0 0 .08-.145c.1-.207.113-.38.027-.553a.867.867 0 0 0-.668-.497.628.628 0 0 0-.042-.005h-6.57a.1.1 0 0 0-.071.03l-4 4a.1.1 0 0 0 0 .14l2.085 2.087a.1.1 0 0 0 .142 0l.5-.5a1.9 1.9 0 0 1 1.343-.557h8.172a.1.1 0 0 0 .07-.03l4.415-4.414c.225-.225.334-.335.39-.434a.539.539 0 0 0 .083-.266.283.283 0 0 0-.026-.11.712.712 0 0 0-.154-.21c-.319-.318-.542-.326-.674-.307-.186.026-.392.146-.554.307-.191.192-.595.553-1.043.946-.904.79-2.143 1.838-2.561 2.144l-.238.174H10.5a.9.9 0 0 1 0-1.8h4.588Z" clip-rule="evenodd"/></svg>',keywords:["offering"],category:"other"},R={name:"question",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M13.672 12.056c-.635.547-1.242 1.07-1.164 2.062h-1.385c-.309-1.553.504-2.214 1.23-2.805.514-.419.986-.802.986-1.442 0-.593-.489-1.068-1.267-1.068-.764 0-1.345.422-1.872 1.187L9 9.067C9.712 7.92 10.807 7.3 12.086 7.3 13.906 7.3 15 8.42 15 9.78c0 1.133-.678 1.717-1.328 2.277Zm-.822 3.763c0 .54-.487 1.028-1.041 1.028-.554 0-1.042-.488-1.042-1.028 0-.528.488-1.029 1.042-1.029s1.042.501 1.042 1.029Z"/><path fill-rule="evenodd" d="M22 12c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10Zm-1.75 0a8.25 8.25 0 1 1-16.5 0 8.25 8.25 0 0 1 16.5 0Z" clip-rule="evenodd"/></svg>',keywords:["question"],category:"status"},$={name:"tag",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M3.1 4a.9.9 0 0 1 .9-.9h6.5a.9.9 0 0 1 .636.264l10 10a.9.9 0 0 1 0 1.272l-4.5 4.5a.9.9 0 1 1-1.272-1.272L19.227 14l-9.1-9.1H4.9v5.227l9.736 9.737a.9.9 0 1 1-1.272 1.272l-10-10A.9.9 0 0 1 3.1 10.5V4ZM8 7.4a.6.6 0 1 0 0 1.2.6.6 0 0 0 0-1.2ZM5.6 8a2.4 2.4 0 1 1 4.8 0 2.4 2.4 0 0 1-4.8 0Z" clip-rule="evenodd"/></svg>',keywords:["tag"],category:"other"};function j(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var f={exports:{}};/*!
|
|
6
6
|
Copyright (c) 2018 Jed Watson.
|
|
7
7
|
Licensed under the MIT License (MIT), see
|
|
8
8
|
http://jedwatson.github.io/classnames
|
|
9
|
-
*/(function(
|
|
9
|
+
*/(function(r){(function(){var s={}.hasOwnProperty;function a(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,u(n)))}return e}function u(e){if(typeof e=="string"||typeof e=="number")return e;if(typeof e!="object")return"";if(Array.isArray(e))return a.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var t="";for(var n in e)s.call(e,n)&&e[n]&&(t=o(t,n));return t}function o(e,t){return t?e?e+" "+t:e+t:e}r.exports?(a.default=a,r.exports=a):window.classNames=a})()})(f);var T=f.exports;const B=j(T),p={"purpur-badge":"_purpur-badge_19vzu_1","purpur-badge--attention":"_purpur-badge--attention_19vzu_13","purpur-badge--special":"_purpur-badge--special_19vzu_17","purpur-badge--neutral":"_purpur-badge--neutral_19vzu_21","purpur-badge--information":"_purpur-badge--information_19vzu_25","purpur-badge--success":"_purpur-badge--success_19vzu_29","purpur-badge--warning":"_purpur-badge--warning_19vzu_33","purpur-badge--error":"_purpur-badge--error_19vzu_37","purpur-badge--black-friday":"_purpur-badge--black-friday_19vzu_41"},d="purpur-badge",l={ATTENTION:"attention",SPECIAL:"special",NEUTRAL:"neutral",INFORMATION:"information",SUCCESS:"success",WARNING:"warning",ERROR:"error",BLACK_FRIDAY:"black-friday"},E=Object.values(l),V=r=>{switch(r){case l.ATTENTION:case l.SPECIAL:return I;case l.INFORMATION:return C;case l.SUCCESS:return M;case l.WARNING:return N;case l.ERROR:return O;case l.NEUTRAL:return R;case l.BLACK_FRIDAY:return $;default:return}},k=({children:r,showIcon:s=!0,variant:a,["data-testid"]:u,allyLabel:o,className:e="",...t})=>{const n=V(a),m=B([e,p[d],p[`${d}--${a}`]]);return c.jsxs("span",{"aria-label":o,className:m,"data-testid":u,...t,children:[s&&n&&c.jsx(g,{"data-testid":`${u}-icon`,allyTitle:o,size:"xs",svg:n}),r]})};exports.BADGE_VARIANT=l;exports.Badge=k;exports.badgeVariants=E;
|
|
10
10
|
//# sourceMappingURL=badge.cjs.js.map
|