@purpurds/badge 6.2.0 → 6.3.1
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.es.js +108 -102
- package/dist/badge.es.js.map +1 -1
- package/package.json +6 -6
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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");function w(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p={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
|
+
*/var d;function y(){return d||(d=1,function(e){(function(){var s={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=o(r,u.call(this,n)))}return r}function u(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var n in r)s.call(r,n)&&r[n]&&(t=o(t,this&&this[n]||n));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()}(p)),p.exports}var b=y();const x=w(b),Z={"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"},A=x.bind(Z),v="purpur-icon",S="md",N=e=>e.filter(s=>Object.keys(s).length>=1).map(s=>`${s.name}="${s.value}"`).join(" "),M=({content:e="",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 ${N(a)}>${u}${e}</svg>`},C=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),h=({["data-testid"]:e,svg:s,allyTitle:a,className:u,size:o=S,...r})=>{const t=M({content:C(s.svg),title:a}),n=A(u,v,`${v}--${o}`);return i.jsx("span",{"aria-label":a,className:n,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};h.displayName="Icon";const O={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"},R={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"},I={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"},$={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"},j={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"},T={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"},B={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 E(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var c={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
|
+
*/var g;function V(){return g||(g=1,function(e){(function(){var s={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=o(r,u(n)))}return r}function u(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return a.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var n in r)s.call(r,n)&&r[n]&&(t=o(t,n));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()}(c)),c.exports}var q=V();const k=E(q),f={"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"},m="purpur-badge",l={ATTENTION:"attention",SPECIAL:"special",NEUTRAL:"neutral",INFORMATION:"information",SUCCESS:"success",WARNING:"warning",ERROR:"error",BLACK_FRIDAY:"black-friday"},z=Object.values(l),H=e=>{switch(e){case l.ATTENTION:case l.SPECIAL:return j;case l.INFORMATION:return $;case l.SUCCESS:return R;case l.WARNING:return O;case l.ERROR:return I;case l.NEUTRAL:return T;case l.BLACK_FRIDAY:return B;default:return}},L=({children:e,showIcon:s=!0,variant:a,["data-testid"]:u,allyLabel:o,className:r="",...t})=>{const n=H(a),_=k([r,f[m],f[`${m}--${a}`]]);return i.jsxs("span",{"aria-label":o,className:_,"data-testid":u,...t,children:[s&&n&&i.jsx(h,{"data-testid":`${u}-icon`,allyTitle:o,size:"xs",svg:n}),e]})};exports.BADGE_VARIANT=l;exports.Badge=L;exports.badgeVariants=z;
|
|
10
10
|
//# sourceMappingURL=badge.cjs.js.map
|
package/dist/badge.cjs.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.cjs.js","sources":["../../icon/dist/icon.es.js","../../icon/dist/assets/alert.es.js","../../icon/dist/assets/check-circle.es.js","../../icon/dist/assets/error.es.js","../../icon/dist/assets/info.es.js","../../icon/dist/assets/offering.es.js","../../icon/dist/assets/question.es.js","../../icon/dist/assets/tag.es.js","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js","../src/badge.tsx"],"sourcesContent":["import { jsx as l } from \"react/jsx-runtime\";\nfunction a(r) {\n return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, \"default\") ? r.default : r;\n}\nvar p = { exports: {} };\n/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n(function(r) {\n (function() {\n var e = {}.hasOwnProperty;\n function s() {\n for (var t = \"\", n = 0; n < arguments.length; n++) {\n var o = arguments[n];\n o && (t = i(t, u.call(this, o)));\n }\n return t;\n }\n function u(t) {\n if (typeof t == \"string\" || typeof t == \"number\")\n return this && this[t] || t;\n if (typeof t != \"object\")\n return \"\";\n if (Array.isArray(t))\n return s.apply(this, t);\n if (t.toString !== Object.prototype.toString && !t.toString.toString().includes(\"[native code]\"))\n return t.toString();\n var n = \"\";\n for (var o in t)\n e.call(t, o) && t[o] && (n = i(n, this && this[o] || o));\n return n;\n }\n function i(t, n) {\n return n ? t ? t + \" \" + n : t + n : t;\n }\n r.exports ? (s.default = s, r.exports = s) : window.classNames = s;\n })();\n})(p);\nvar m = p.exports;\nconst f = /* @__PURE__ */ a(m), _ = {\n \"purpur-icon\": \"_purpur-icon_8u1lq_1\",\n \"purpur-icon--xxs\": \"_purpur-icon--xxs_8u1lq_4\",\n \"purpur-icon--xs\": \"_purpur-icon--xs_8u1lq_8\",\n \"purpur-icon--sm\": \"_purpur-icon--sm_8u1lq_12\",\n \"purpur-icon--md\": \"_purpur-icon--md_8u1lq_16\",\n \"purpur-icon--lg\": \"_purpur-icon--lg_8u1lq_20\",\n \"purpur-icon--xl\": \"_purpur-icon--xl_8u1lq_24\"\n}, d = f.bind(_), c = \"purpur-icon\", y = [\"xxs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\"], v = \"md\", x = (r) => r.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}=\"${e.value}\"`).join(\" \"), g = ({ content: r = \"\", title: e } = {}) => {\n const s = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"currentColor\" },\n { name: \"viewBox\", value: \"0 0 24 24\" },\n e ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" }\n ], u = e ? `<title>${e}</title>` : \"\";\n return `<svg ${x(s)}>${u}${r}</svg>`;\n}, h = (r) => r.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim(), b = ({\n [\"data-testid\"]: r,\n svg: e,\n allyTitle: s,\n className: u,\n size: i = v,\n ...t\n}) => {\n const n = g({\n content: h(e.svg),\n title: s\n }), o = d(u, c, `${c}--${i}`);\n return /* @__PURE__ */ l(\n \"span\",\n {\n \"aria-label\": s,\n className: o,\n \"data-testid\": r,\n dangerouslySetInnerHTML: { __html: n },\n ...t\n }\n );\n};\nb.displayName = \"Icon\";\nexport {\n v as DEFAULT_SIZE,\n b as Icon,\n y as sizes\n};\n//# sourceMappingURL=icon.es.js.map\n","const e = {\n name: \"alert\",\n 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>',\n keywords: [\"alert\"],\n category: \"status\"\n};\nexport {\n e as alert\n};\n//# sourceMappingURL=alert.es.js.map\n","const e = {\n name: \"check-circle\",\n 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>',\n keywords: [\"check-circle\"],\n category: \"status\"\n};\nexport {\n e as checkCircle\n};\n//# sourceMappingURL=check-circle.es.js.map\n","const l = {\n name: \"error\",\n 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>',\n keywords: [\"error\"],\n category: \"status\"\n};\nexport {\n l as error\n};\n//# sourceMappingURL=error.es.js.map\n","const o = {\n name: \"info\",\n 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>',\n keywords: [\"info\"],\n category: \"status\"\n};\nexport {\n o as info\n};\n//# sourceMappingURL=info.es.js.map\n","const a = {\n name: \"offering\",\n 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>',\n keywords: [\"offering\"],\n category: \"other\"\n};\nexport {\n a as offering\n};\n//# sourceMappingURL=offering.es.js.map\n","const e = {\n name: \"question\",\n 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>',\n keywords: [\"question\"],\n category: \"status\"\n};\nexport {\n e as question\n};\n//# sourceMappingURL=question.es.js.map\n","const l = {\n name: \"tag\",\n 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>',\n keywords: [\"tag\"],\n category: \"other\"\n};\nexport {\n l as tag\n};\n//# sourceMappingURL=tag.es.js.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { ReactNode } from \"react\";\nimport { Icon } from \"@purpurds/icon\";\nimport { alert } from \"@purpurds/icon/assets/alert\";\nimport { checkCircle } from \"@purpurds/icon/assets/check-circle\";\nimport { error } from \"@purpurds/icon/assets/error\";\nimport { info } from \"@purpurds/icon/assets/info\";\nimport { offering } from \"@purpurds/icon/assets/offering\";\nimport { question } from \"@purpurds/icon/assets/question\";\nimport { tag } from \"@purpurds/icon/assets/tag\";\nimport c from \"classnames\";\n\nimport styles from \"./badge.module.scss\";\nconst rootClassName = \"purpur-badge\";\n\nexport const BADGE_VARIANT = {\n ATTENTION: \"attention\",\n SPECIAL: \"special\",\n NEUTRAL: \"neutral\",\n INFORMATION: \"information\",\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n BLACK_FRIDAY: \"black-friday\",\n} as const;\n\nexport const badgeVariants = Object.values(BADGE_VARIANT);\nexport type BadgeVariant = (typeof BADGE_VARIANT)[keyof typeof BADGE_VARIANT];\n\nconst getIcon = (variant: BadgeVariant) => {\n switch (variant) {\n case BADGE_VARIANT.ATTENTION:\n case BADGE_VARIANT.SPECIAL:\n return offering;\n case BADGE_VARIANT.INFORMATION:\n return info;\n case BADGE_VARIANT.SUCCESS:\n return checkCircle;\n case BADGE_VARIANT.WARNING:\n return alert;\n case BADGE_VARIANT.ERROR:\n return error;\n case BADGE_VARIANT.NEUTRAL:\n return question;\n case BADGE_VARIANT.BLACK_FRIDAY:\n return tag;\n default:\n return;\n }\n};\n\nexport type BadgeProps = {\n children: ReactNode;\n showIcon?: boolean;\n variant: BadgeVariant;\n [\"data-testid\"]?: string;\n allyLabel?: string;\n className?: string;\n};\n\nexport const Badge = ({\n children,\n showIcon = true,\n variant,\n [\"data-testid\"]: dataTestid,\n allyLabel,\n className = \"\",\n ...props\n}: BadgeProps) => {\n const icon = getIcon(variant);\n\n const classes = c([className, styles[rootClassName], styles[`${rootClassName}--${variant}`]]);\n\n return (\n <span aria-label={allyLabel} className={classes} data-testid={dataTestid} {...props}>\n {showIcon && icon && (\n <Icon data-testid={`${dataTestid}-icon`} allyTitle={allyLabel} size=\"xs\" svg={icon} />\n )}\n {children}\n </span>\n );\n};\n"],"names":["a","p","e","s","t","n","o","i","m","f","_","d","c","v","x","g","h","b","l","hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","rootClassName","BADGE_VARIANT","badgeVariants","getIcon","variant","offering","info","checkCircle","alert","error","question","tag","Badge","children","showIcon","dataTestid","allyLabel","className","props","icon","styles","jsxs","jsx","Icon"],"mappings":"qHACA,SAASA,EAAE,EAAG,CACZ,OAAO,GAAK,EAAE,YAAc,OAAO,UAAU,eAAe,KAAK,EAAG,SAAS,EAAI,EAAE,QAAU,CAC/F,CACA,IAAIC,EAAI,CAAE,QAAS,EAAI,EACv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YACX,QAAS,UACT,QAAS,UACT,YAAa,cACb,QAAS,UACT,QAAS,UACT,MAAO,QACP,aAAc,cAChB,EAEaC,EAAgB,OAAO,OAAOD,CAAa,EAGlDE,EAAWC,GAA0B,CACzC,OAAQA,EAAS,CACf,KAAKH,EAAc,UACnB,KAAKA,EAAc,QACV,OAAAI,EACT,KAAKJ,EAAc,YACV,OAAAK,EACT,KAAKL,EAAc,QACV,OAAAM,EACT,KAAKN,EAAc,QACV,OAAAO,EACT,KAAKP,EAAc,MACV,OAAAQ,EACT,KAAKR,EAAc,QACV,OAAAS,EACT,KAAKT,EAAc,aACV,OAAAU,EACT,QACE,MAAA,CAEN,EAWaC,EAAQ,CAAC,CACpB,SAAAC,EACA,SAAAC,EAAW,GACX,QAAAV,EACA,CAAC,eAAgBW,EACjB,UAAAC,EACA,UAAAC,EAAY,GACZ,GAAGC,CACL,IAAkB,CACV,MAAAC,EAAOhB,EAAQC,CAAO,EAEtBZ,EAAUT,EAAE,CAACkC,EAAWG,EAAOpB,CAAa,EAAGoB,EAAO,GAAGpB,CAAa,KAAKI,CAAO,EAAE,CAAC,CAAC,EAG1F,OAAAiB,OAAC,QAAK,aAAYL,EAAW,UAAWxB,EAAS,cAAauB,EAAa,GAAGG,EAC3E,SAAA,CAAAJ,GAAYK,GACXG,EAAA,IAACC,EAAK,CAAA,cAAa,GAAGR,CAAU,QAAS,UAAWC,EAAW,KAAK,KAAK,IAAKG,EAAM,EAErFN,CAAA,EACH,CAEJ","x_google_ignoreList":[8]}
|
|
1
|
+
{"version":3,"file":"badge.cjs.js","sources":["../../icon/dist/icon.es.js","../../icon/dist/assets/alert.es.js","../../icon/dist/assets/check-circle.es.js","../../icon/dist/assets/error.es.js","../../icon/dist/assets/info.es.js","../../icon/dist/assets/offering.es.js","../../icon/dist/assets/question.es.js","../../icon/dist/assets/tag.es.js","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js","../src/badge.tsx"],"sourcesContent":["import { jsx as a } from \"react/jsx-runtime\";\nfunction f(r) {\n return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, \"default\") ? r.default : r;\n}\nvar c = { exports: {} };\n/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\nvar p;\nfunction m() {\n return p || (p = 1, function(r) {\n (function() {\n var e = {}.hasOwnProperty;\n function s() {\n for (var t = \"\", n = 0; n < arguments.length; n++) {\n var o = arguments[n];\n o && (t = i(t, u.call(this, o)));\n }\n return t;\n }\n function u(t) {\n if (typeof t == \"string\" || typeof t == \"number\")\n return this && this[t] || t;\n if (typeof t != \"object\")\n return \"\";\n if (Array.isArray(t))\n return s.apply(this, t);\n if (t.toString !== Object.prototype.toString && !t.toString.toString().includes(\"[native code]\"))\n return t.toString();\n var n = \"\";\n for (var o in t)\n e.call(t, o) && t[o] && (n = i(n, this && this[o] || o));\n return n;\n }\n function i(t, n) {\n return n ? t ? t + \" \" + n : t + n : t;\n }\n r.exports ? (s.default = s, r.exports = s) : window.classNames = s;\n })();\n }(c)), c.exports;\n}\nvar _ = m();\nconst d = /* @__PURE__ */ f(_), v = {\n \"purpur-icon\": \"_purpur-icon_8u1lq_1\",\n \"purpur-icon--xxs\": \"_purpur-icon--xxs_8u1lq_4\",\n \"purpur-icon--xs\": \"_purpur-icon--xs_8u1lq_8\",\n \"purpur-icon--sm\": \"_purpur-icon--sm_8u1lq_12\",\n \"purpur-icon--md\": \"_purpur-icon--md_8u1lq_16\",\n \"purpur-icon--lg\": \"_purpur-icon--lg_8u1lq_20\",\n \"purpur-icon--xl\": \"_purpur-icon--xl_8u1lq_24\"\n}, x = d.bind(v), l = \"purpur-icon\", w = [\"xxs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\"], g = \"md\", h = (r) => r.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}=\"${e.value}\"`).join(\" \"), b = ({ content: r = \"\", title: e } = {}) => {\n const s = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"currentColor\" },\n { name: \"viewBox\", value: \"0 0 24 24\" },\n e ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" }\n ], u = e ? `<title>${e}</title>` : \"\";\n return `<svg ${h(s)}>${u}${r}</svg>`;\n}, S = (r) => r.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim(), y = ({\n [\"data-testid\"]: r,\n svg: e,\n allyTitle: s,\n className: u,\n size: i = g,\n ...t\n}) => {\n const n = b({\n content: S(e.svg),\n title: s\n }), o = x(u, l, `${l}--${i}`);\n return /* @__PURE__ */ a(\n \"span\",\n {\n \"aria-label\": s,\n className: o,\n \"data-testid\": r,\n dangerouslySetInnerHTML: { __html: n },\n ...t\n }\n );\n};\ny.displayName = \"Icon\";\nexport {\n g as DEFAULT_SIZE,\n y as Icon,\n w as sizes\n};\n//# sourceMappingURL=icon.es.js.map\n","const e = {\n name: \"alert\",\n 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>',\n keywords: [\"alert\"],\n category: \"status\"\n};\nexport {\n e as alert\n};\n//# sourceMappingURL=alert.es.js.map\n","const e = {\n name: \"check-circle\",\n 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>',\n keywords: [\"check-circle\"],\n category: \"status\"\n};\nexport {\n e as checkCircle\n};\n//# sourceMappingURL=check-circle.es.js.map\n","const l = {\n name: \"error\",\n 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>',\n keywords: [\"error\"],\n category: \"status\"\n};\nexport {\n l as error\n};\n//# sourceMappingURL=error.es.js.map\n","const o = {\n name: \"info\",\n 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>',\n keywords: [\"info\"],\n category: \"status\"\n};\nexport {\n o as info\n};\n//# sourceMappingURL=info.es.js.map\n","const a = {\n name: \"offering\",\n 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>',\n keywords: [\"offering\"],\n category: \"other\"\n};\nexport {\n a as offering\n};\n//# sourceMappingURL=offering.es.js.map\n","const e = {\n name: \"question\",\n 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>',\n keywords: [\"question\"],\n category: \"status\"\n};\nexport {\n e as question\n};\n//# sourceMappingURL=question.es.js.map\n","const l = {\n name: \"tag\",\n 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>',\n keywords: [\"tag\"],\n category: \"other\"\n};\nexport {\n l as tag\n};\n//# sourceMappingURL=tag.es.js.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { ReactNode } from \"react\";\nimport { Icon } from \"@purpurds/icon\";\nimport { alert } from \"@purpurds/icon/assets/alert\";\nimport { checkCircle } from \"@purpurds/icon/assets/check-circle\";\nimport { error } from \"@purpurds/icon/assets/error\";\nimport { info } from \"@purpurds/icon/assets/info\";\nimport { offering } from \"@purpurds/icon/assets/offering\";\nimport { question } from \"@purpurds/icon/assets/question\";\nimport { tag } from \"@purpurds/icon/assets/tag\";\nimport c from \"classnames\";\n\nimport styles from \"./badge.module.scss\";\nconst rootClassName = \"purpur-badge\";\n\nexport const BADGE_VARIANT = {\n ATTENTION: \"attention\",\n SPECIAL: \"special\",\n NEUTRAL: \"neutral\",\n INFORMATION: \"information\",\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n BLACK_FRIDAY: \"black-friday\",\n} as const;\n\nexport const badgeVariants = Object.values(BADGE_VARIANT);\nexport type BadgeVariant = (typeof BADGE_VARIANT)[keyof typeof BADGE_VARIANT];\n\nconst getIcon = (variant: BadgeVariant) => {\n switch (variant) {\n case BADGE_VARIANT.ATTENTION:\n case BADGE_VARIANT.SPECIAL:\n return offering;\n case BADGE_VARIANT.INFORMATION:\n return info;\n case BADGE_VARIANT.SUCCESS:\n return checkCircle;\n case BADGE_VARIANT.WARNING:\n return alert;\n case BADGE_VARIANT.ERROR:\n return error;\n case BADGE_VARIANT.NEUTRAL:\n return question;\n case BADGE_VARIANT.BLACK_FRIDAY:\n return tag;\n default:\n return;\n }\n};\n\nexport type BadgeProps = {\n children: ReactNode;\n showIcon?: boolean;\n variant: BadgeVariant;\n [\"data-testid\"]?: string;\n allyLabel?: string;\n className?: string;\n};\n\nexport const Badge = ({\n children,\n showIcon = true,\n variant,\n [\"data-testid\"]: dataTestid,\n allyLabel,\n className = \"\",\n ...props\n}: BadgeProps) => {\n const icon = getIcon(variant);\n\n const classes = c([className, styles[rootClassName], styles[`${rootClassName}--${variant}`]]);\n\n return (\n <span aria-label={allyLabel} className={classes} data-testid={dataTestid} {...props}>\n {showIcon && icon && (\n <Icon data-testid={`${dataTestid}-icon`} allyTitle={allyLabel} size=\"xs\" svg={icon} />\n )}\n {children}\n </span>\n );\n};\n"],"names":["f","r","c","p","m","e","s","t","n","o","i","_","d","v","x","l","g","h","b","S","y","a","hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","rootClassName","BADGE_VARIANT","badgeVariants","getIcon","variant","offering","info","checkCircle","alert","error","question","tag","Badge","children","showIcon","dataTestid","allyLabel","className","props","icon","styles","jsxs","jsx","Icon"],"mappings":"qHACA,SAASA,EAAEC,EAAG,CACZ,OAAOA,GAAKA,EAAE,YAAc,OAAO,UAAU,eAAe,KAAKA,EAAG,SAAS,EAAIA,EAAE,QAAUA,CAC/F,CACA,IAAIC,EAAI,CAAE,QAAS,EAAI,EACvB;AAAA;AAAA;AAAA;AAAA,EAKA,IAAIC,EACJ,SAASC,GAAI,CACX,OAAOD,IAAMA,EAAI,EAAG,SAASF,EAAG,EAC7B,UAAW,CACV,IAAII,EAAI,CAAA,EAAG,eACX,SAASC,GAAI,CACX,QAASC,EAAI,GAAIC,EAAI,EAAGA,EAAI,UAAU,OAAQA,IAAK,CACjD,IAAIC,EAAI,UAAUD,CAAC,EACnBC,IAAMF,EAAIG,EAAEH,EAAG,EAAE,KAAK,KAAME,CAAC,CAAC,EACxC,CACQ,OAAOF,CACf,CACM,SAAS,EAAEA,EAAG,CACZ,GAAI,OAAOA,GAAK,UAAY,OAAOA,GAAK,SACtC,OAAO,MAAQ,KAAKA,CAAC,GAAKA,EAC5B,GAAI,OAAOA,GAAK,SACd,MAAO,GACT,GAAI,MAAM,QAAQA,CAAC,EACjB,OAAOD,EAAE,MAAM,KAAMC,CAAC,EACxB,GAAIA,EAAE,WAAa,OAAO,UAAU,UAAY,CAACA,EAAE,SAAS,WAAW,SAAS,eAAe,EAC7F,OAAOA,EAAE,SAAU,EACrB,IAAIC,EAAI,GACR,QAASC,KAAKF,EACZF,EAAE,KAAKE,EAAGE,CAAC,GAAKF,EAAEE,CAAC,IAAMD,EAAIE,EAAEF,EAAG,MAAQ,KAAKC,CAAC,GAAKA,CAAC,GACxD,OAAOD,CACf,CACM,SAASE,EAAEH,EAAGC,EAAG,CACf,OAAOA,EAAID,EAAIA,EAAI,IAAMC,EAAID,EAAIC,EAAID,CAC7C,CACMN,EAAE,SAAWK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,GAAGR,CAAU,QAAS,UAAWC,EAAW,KAAK,KAAK,IAAKG,EAAM,EAErFN,CAAA,EACH,CAEJ","x_google_ignoreList":[8]}
|
package/dist/badge.es.js
CHANGED
|
@@ -1,45 +1,48 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function
|
|
1
|
+
import { jsx as m, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
+
function y(e) {
|
|
3
3
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
4
4
|
}
|
|
5
|
-
var
|
|
5
|
+
var i = { exports: {} };
|
|
6
6
|
/*!
|
|
7
7
|
Copyright (c) 2018 Jed Watson.
|
|
8
8
|
Licensed under the MIT License (MIT), see
|
|
9
9
|
http://jedwatson.github.io/classnames
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
var p;
|
|
12
|
+
function b() {
|
|
13
|
+
return p || (p = 1, function(e) {
|
|
14
|
+
(function() {
|
|
15
|
+
var s = {}.hasOwnProperty;
|
|
16
|
+
function a() {
|
|
17
|
+
for (var r = "", t = 0; t < arguments.length; t++) {
|
|
18
|
+
var n = arguments[t];
|
|
19
|
+
n && (r = o(r, u.call(this, n)));
|
|
20
|
+
}
|
|
21
|
+
return r;
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const y = /* @__PURE__ */ w(_), b = {
|
|
23
|
+
function u(r) {
|
|
24
|
+
if (typeof r == "string" || typeof r == "number")
|
|
25
|
+
return this && this[r] || r;
|
|
26
|
+
if (typeof r != "object")
|
|
27
|
+
return "";
|
|
28
|
+
if (Array.isArray(r))
|
|
29
|
+
return a.apply(this, r);
|
|
30
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
31
|
+
return r.toString();
|
|
32
|
+
var t = "";
|
|
33
|
+
for (var n in r)
|
|
34
|
+
s.call(r, n) && r[n] && (t = o(t, this && this[n] || n));
|
|
35
|
+
return t;
|
|
36
|
+
}
|
|
37
|
+
function o(r, t) {
|
|
38
|
+
return t ? r ? r + " " + t : r + t : r;
|
|
39
|
+
}
|
|
40
|
+
e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
|
|
41
|
+
})();
|
|
42
|
+
}(i)), i.exports;
|
|
43
|
+
}
|
|
44
|
+
var x = b();
|
|
45
|
+
const Z = /* @__PURE__ */ y(x), A = {
|
|
43
46
|
"purpur-icon": "_purpur-icon_8u1lq_1",
|
|
44
47
|
"purpur-icon--xxs": "_purpur-icon--xxs_8u1lq_4",
|
|
45
48
|
"purpur-icon--xs": "_purpur-icon--xs_8u1lq_8",
|
|
@@ -47,27 +50,27 @@ const y = /* @__PURE__ */ w(_), b = {
|
|
|
47
50
|
"purpur-icon--md": "_purpur-icon--md_8u1lq_16",
|
|
48
51
|
"purpur-icon--lg": "_purpur-icon--lg_8u1lq_20",
|
|
49
52
|
"purpur-icon--xl": "_purpur-icon--xl_8u1lq_24"
|
|
50
|
-
},
|
|
53
|
+
}, S = Z.bind(A), d = "purpur-icon", N = "md", M = (e) => e.filter((s) => Object.keys(s).length >= 1).map((s) => `${s.name}="${s.value}"`).join(" "), C = ({ content: e = "", title: s } = {}) => {
|
|
51
54
|
const a = [
|
|
52
55
|
{ name: "xmlns", value: "http://www.w3.org/2000/svg" },
|
|
53
56
|
{ name: "fill", value: "currentColor" },
|
|
54
57
|
{ name: "viewBox", value: "0 0 24 24" },
|
|
55
58
|
s ? { name: "role", value: "img" } : { name: "aria-hidden", value: "true" }
|
|
56
|
-
],
|
|
57
|
-
return `<svg ${
|
|
58
|
-
},
|
|
59
|
+
], u = s ? `<title>${s}</title>` : "";
|
|
60
|
+
return `<svg ${M(a)}>${u}${e}</svg>`;
|
|
61
|
+
}, O = (e) => e.replace(/<(\/?)svg([^>]*)>/g, "").trim(), h = ({
|
|
59
62
|
["data-testid"]: e,
|
|
60
63
|
svg: s,
|
|
61
64
|
allyTitle: a,
|
|
62
|
-
className:
|
|
63
|
-
size:
|
|
65
|
+
className: u,
|
|
66
|
+
size: o = N,
|
|
64
67
|
...r
|
|
65
68
|
}) => {
|
|
66
|
-
const t =
|
|
67
|
-
content:
|
|
69
|
+
const t = C({
|
|
70
|
+
content: O(s.svg),
|
|
68
71
|
title: a
|
|
69
|
-
}), n =
|
|
70
|
-
return /* @__PURE__ */
|
|
72
|
+
}), n = S(u, d, `${d}--${o}`);
|
|
73
|
+
return /* @__PURE__ */ m(
|
|
71
74
|
"span",
|
|
72
75
|
{
|
|
73
76
|
"aria-label": a,
|
|
@@ -78,84 +81,87 @@ const y = /* @__PURE__ */ w(_), b = {
|
|
|
78
81
|
}
|
|
79
82
|
);
|
|
80
83
|
};
|
|
81
|
-
|
|
82
|
-
const
|
|
84
|
+
h.displayName = "Icon";
|
|
85
|
+
const I = {
|
|
83
86
|
name: "alert",
|
|
84
87
|
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>',
|
|
85
88
|
keywords: ["alert"],
|
|
86
89
|
category: "status"
|
|
87
|
-
},
|
|
90
|
+
}, R = {
|
|
88
91
|
name: "check-circle",
|
|
89
92
|
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>',
|
|
90
93
|
keywords: ["check-circle"],
|
|
91
94
|
category: "status"
|
|
92
|
-
},
|
|
95
|
+
}, $ = {
|
|
93
96
|
name: "error",
|
|
94
97
|
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>',
|
|
95
98
|
keywords: ["error"],
|
|
96
99
|
category: "status"
|
|
97
|
-
},
|
|
100
|
+
}, E = {
|
|
98
101
|
name: "info",
|
|
99
102
|
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>',
|
|
100
103
|
keywords: ["info"],
|
|
101
104
|
category: "status"
|
|
102
|
-
},
|
|
105
|
+
}, T = {
|
|
103
106
|
name: "offering",
|
|
104
107
|
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>',
|
|
105
108
|
keywords: ["offering"],
|
|
106
109
|
category: "other"
|
|
107
|
-
},
|
|
110
|
+
}, j = {
|
|
108
111
|
name: "question",
|
|
109
112
|
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>',
|
|
110
113
|
keywords: ["question"],
|
|
111
114
|
category: "status"
|
|
112
|
-
},
|
|
115
|
+
}, B = {
|
|
113
116
|
name: "tag",
|
|
114
117
|
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>',
|
|
115
118
|
keywords: ["tag"],
|
|
116
119
|
category: "other"
|
|
117
120
|
};
|
|
118
|
-
function
|
|
121
|
+
function k(e) {
|
|
119
122
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
120
123
|
}
|
|
121
|
-
var
|
|
124
|
+
var c = { exports: {} };
|
|
122
125
|
/*!
|
|
123
126
|
Copyright (c) 2018 Jed Watson.
|
|
124
127
|
Licensed under the MIT License (MIT), see
|
|
125
128
|
http://jedwatson.github.io/classnames
|
|
126
129
|
*/
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
function
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
function o(r) {
|
|
138
|
-
if (typeof r == "string" || typeof r == "number")
|
|
130
|
+
var v;
|
|
131
|
+
function q() {
|
|
132
|
+
return v || (v = 1, function(e) {
|
|
133
|
+
(function() {
|
|
134
|
+
var s = {}.hasOwnProperty;
|
|
135
|
+
function a() {
|
|
136
|
+
for (var r = "", t = 0; t < arguments.length; t++) {
|
|
137
|
+
var n = arguments[t];
|
|
138
|
+
n && (r = o(r, u(n)));
|
|
139
|
+
}
|
|
139
140
|
return r;
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
141
|
+
}
|
|
142
|
+
function u(r) {
|
|
143
|
+
if (typeof r == "string" || typeof r == "number")
|
|
144
|
+
return r;
|
|
145
|
+
if (typeof r != "object")
|
|
146
|
+
return "";
|
|
147
|
+
if (Array.isArray(r))
|
|
148
|
+
return a.apply(null, r);
|
|
149
|
+
if (r.toString !== Object.prototype.toString && !r.toString.toString().includes("[native code]"))
|
|
150
|
+
return r.toString();
|
|
151
|
+
var t = "";
|
|
152
|
+
for (var n in r)
|
|
153
|
+
s.call(r, n) && r[n] && (t = o(t, n));
|
|
154
|
+
return t;
|
|
155
|
+
}
|
|
156
|
+
function o(r, t) {
|
|
157
|
+
return t ? r ? r + " " + t : r + t : r;
|
|
158
|
+
}
|
|
159
|
+
e.exports ? (a.default = a, e.exports = a) : window.classNames = a;
|
|
160
|
+
})();
|
|
161
|
+
}(c)), c.exports;
|
|
162
|
+
}
|
|
163
|
+
var z = q();
|
|
164
|
+
const V = /* @__PURE__ */ k(z), g = {
|
|
159
165
|
"purpur-badge": "_purpur-badge_19vzu_1",
|
|
160
166
|
"purpur-badge--attention": "_purpur-badge--attention_19vzu_13",
|
|
161
167
|
"purpur-badge--special": "_purpur-badge--special_19vzu_17",
|
|
@@ -165,7 +171,7 @@ const B = /* @__PURE__ */ T(j), i = {
|
|
|
165
171
|
"purpur-badge--warning": "_purpur-badge--warning_19vzu_33",
|
|
166
172
|
"purpur-badge--error": "_purpur-badge--error_19vzu_37",
|
|
167
173
|
"purpur-badge--black-friday": "_purpur-badge--black-friday_19vzu_41"
|
|
168
|
-
},
|
|
174
|
+
}, f = "purpur-badge", l = {
|
|
169
175
|
ATTENTION: "attention",
|
|
170
176
|
SPECIAL: "special",
|
|
171
177
|
NEUTRAL: "neutral",
|
|
@@ -174,44 +180,44 @@ const B = /* @__PURE__ */ T(j), i = {
|
|
|
174
180
|
WARNING: "warning",
|
|
175
181
|
ERROR: "error",
|
|
176
182
|
BLACK_FRIDAY: "black-friday"
|
|
177
|
-
},
|
|
183
|
+
}, P = Object.values(l), H = (e) => {
|
|
178
184
|
switch (e) {
|
|
179
185
|
case l.ATTENTION:
|
|
180
186
|
case l.SPECIAL:
|
|
181
|
-
return
|
|
187
|
+
return T;
|
|
182
188
|
case l.INFORMATION:
|
|
183
|
-
return
|
|
189
|
+
return E;
|
|
184
190
|
case l.SUCCESS:
|
|
185
|
-
return
|
|
191
|
+
return R;
|
|
186
192
|
case l.WARNING:
|
|
187
|
-
return
|
|
193
|
+
return I;
|
|
188
194
|
case l.ERROR:
|
|
189
|
-
return
|
|
195
|
+
return $;
|
|
190
196
|
case l.NEUTRAL:
|
|
191
|
-
return
|
|
197
|
+
return j;
|
|
192
198
|
case l.BLACK_FRIDAY:
|
|
193
|
-
return
|
|
199
|
+
return B;
|
|
194
200
|
default:
|
|
195
201
|
return;
|
|
196
202
|
}
|
|
197
|
-
},
|
|
203
|
+
}, F = ({
|
|
198
204
|
children: e,
|
|
199
205
|
showIcon: s = !0,
|
|
200
206
|
variant: a,
|
|
201
|
-
["data-testid"]:
|
|
202
|
-
allyLabel:
|
|
207
|
+
["data-testid"]: u,
|
|
208
|
+
allyLabel: o,
|
|
203
209
|
className: r = "",
|
|
204
210
|
...t
|
|
205
211
|
}) => {
|
|
206
|
-
const n =
|
|
207
|
-
return /* @__PURE__ */
|
|
208
|
-
s && n && /* @__PURE__ */
|
|
212
|
+
const n = H(a), w = V([r, g[f], g[`${f}--${a}`]]);
|
|
213
|
+
return /* @__PURE__ */ _("span", { "aria-label": o, className: w, "data-testid": u, ...t, children: [
|
|
214
|
+
s && n && /* @__PURE__ */ m(h, { "data-testid": `${u}-icon`, allyTitle: o, size: "xs", svg: n }),
|
|
209
215
|
e
|
|
210
216
|
] });
|
|
211
217
|
};
|
|
212
218
|
export {
|
|
213
219
|
l as BADGE_VARIANT,
|
|
214
|
-
|
|
215
|
-
|
|
220
|
+
F as Badge,
|
|
221
|
+
P as badgeVariants
|
|
216
222
|
};
|
|
217
223
|
//# sourceMappingURL=badge.es.js.map
|
package/dist/badge.es.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.es.js","sources":["../../icon/dist/icon.es.js","../../icon/dist/assets/alert.es.js","../../icon/dist/assets/check-circle.es.js","../../icon/dist/assets/error.es.js","../../icon/dist/assets/info.es.js","../../icon/dist/assets/offering.es.js","../../icon/dist/assets/question.es.js","../../icon/dist/assets/tag.es.js","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js","../src/badge.tsx"],"sourcesContent":["import { jsx as l } from \"react/jsx-runtime\";\nfunction a(r) {\n return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, \"default\") ? r.default : r;\n}\nvar p = { exports: {} };\n/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n(function(r) {\n (function() {\n var e = {}.hasOwnProperty;\n function s() {\n for (var t = \"\", n = 0; n < arguments.length; n++) {\n var o = arguments[n];\n o && (t = i(t, u.call(this, o)));\n }\n return t;\n }\n function u(t) {\n if (typeof t == \"string\" || typeof t == \"number\")\n return this && this[t] || t;\n if (typeof t != \"object\")\n return \"\";\n if (Array.isArray(t))\n return s.apply(this, t);\n if (t.toString !== Object.prototype.toString && !t.toString.toString().includes(\"[native code]\"))\n return t.toString();\n var n = \"\";\n for (var o in t)\n e.call(t, o) && t[o] && (n = i(n, this && this[o] || o));\n return n;\n }\n function i(t, n) {\n return n ? t ? t + \" \" + n : t + n : t;\n }\n r.exports ? (s.default = s, r.exports = s) : window.classNames = s;\n })();\n})(p);\nvar m = p.exports;\nconst f = /* @__PURE__ */ a(m), _ = {\n \"purpur-icon\": \"_purpur-icon_8u1lq_1\",\n \"purpur-icon--xxs\": \"_purpur-icon--xxs_8u1lq_4\",\n \"purpur-icon--xs\": \"_purpur-icon--xs_8u1lq_8\",\n \"purpur-icon--sm\": \"_purpur-icon--sm_8u1lq_12\",\n \"purpur-icon--md\": \"_purpur-icon--md_8u1lq_16\",\n \"purpur-icon--lg\": \"_purpur-icon--lg_8u1lq_20\",\n \"purpur-icon--xl\": \"_purpur-icon--xl_8u1lq_24\"\n}, d = f.bind(_), c = \"purpur-icon\", y = [\"xxs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\"], v = \"md\", x = (r) => r.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}=\"${e.value}\"`).join(\" \"), g = ({ content: r = \"\", title: e } = {}) => {\n const s = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"currentColor\" },\n { name: \"viewBox\", value: \"0 0 24 24\" },\n e ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" }\n ], u = e ? `<title>${e}</title>` : \"\";\n return `<svg ${x(s)}>${u}${r}</svg>`;\n}, h = (r) => r.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim(), b = ({\n [\"data-testid\"]: r,\n svg: e,\n allyTitle: s,\n className: u,\n size: i = v,\n ...t\n}) => {\n const n = g({\n content: h(e.svg),\n title: s\n }), o = d(u, c, `${c}--${i}`);\n return /* @__PURE__ */ l(\n \"span\",\n {\n \"aria-label\": s,\n className: o,\n \"data-testid\": r,\n dangerouslySetInnerHTML: { __html: n },\n ...t\n }\n );\n};\nb.displayName = \"Icon\";\nexport {\n v as DEFAULT_SIZE,\n b as Icon,\n y as sizes\n};\n//# sourceMappingURL=icon.es.js.map\n","const e = {\n name: \"alert\",\n 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>',\n keywords: [\"alert\"],\n category: \"status\"\n};\nexport {\n e as alert\n};\n//# sourceMappingURL=alert.es.js.map\n","const e = {\n name: \"check-circle\",\n 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>',\n keywords: [\"check-circle\"],\n category: \"status\"\n};\nexport {\n e as checkCircle\n};\n//# sourceMappingURL=check-circle.es.js.map\n","const l = {\n name: \"error\",\n 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>',\n keywords: [\"error\"],\n category: \"status\"\n};\nexport {\n l as error\n};\n//# sourceMappingURL=error.es.js.map\n","const o = {\n name: \"info\",\n 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>',\n keywords: [\"info\"],\n category: \"status\"\n};\nexport {\n o as info\n};\n//# sourceMappingURL=info.es.js.map\n","const a = {\n name: \"offering\",\n 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>',\n keywords: [\"offering\"],\n category: \"other\"\n};\nexport {\n a as offering\n};\n//# sourceMappingURL=offering.es.js.map\n","const e = {\n name: \"question\",\n 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>',\n keywords: [\"question\"],\n category: \"status\"\n};\nexport {\n e as question\n};\n//# sourceMappingURL=question.es.js.map\n","const l = {\n name: \"tag\",\n 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>',\n keywords: [\"tag\"],\n category: \"other\"\n};\nexport {\n l as tag\n};\n//# sourceMappingURL=tag.es.js.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { ReactNode } from \"react\";\nimport { Icon } from \"@purpurds/icon\";\nimport { alert } from \"@purpurds/icon/assets/alert\";\nimport { checkCircle } from \"@purpurds/icon/assets/check-circle\";\nimport { error } from \"@purpurds/icon/assets/error\";\nimport { info } from \"@purpurds/icon/assets/info\";\nimport { offering } from \"@purpurds/icon/assets/offering\";\nimport { question } from \"@purpurds/icon/assets/question\";\nimport { tag } from \"@purpurds/icon/assets/tag\";\nimport c from \"classnames\";\n\nimport styles from \"./badge.module.scss\";\nconst rootClassName = \"purpur-badge\";\n\nexport const BADGE_VARIANT = {\n ATTENTION: \"attention\",\n SPECIAL: \"special\",\n NEUTRAL: \"neutral\",\n INFORMATION: \"information\",\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n BLACK_FRIDAY: \"black-friday\",\n} as const;\n\nexport const badgeVariants = Object.values(BADGE_VARIANT);\nexport type BadgeVariant = (typeof BADGE_VARIANT)[keyof typeof BADGE_VARIANT];\n\nconst getIcon = (variant: BadgeVariant) => {\n switch (variant) {\n case BADGE_VARIANT.ATTENTION:\n case BADGE_VARIANT.SPECIAL:\n return offering;\n case BADGE_VARIANT.INFORMATION:\n return info;\n case BADGE_VARIANT.SUCCESS:\n return checkCircle;\n case BADGE_VARIANT.WARNING:\n return alert;\n case BADGE_VARIANT.ERROR:\n return error;\n case BADGE_VARIANT.NEUTRAL:\n return question;\n case BADGE_VARIANT.BLACK_FRIDAY:\n return tag;\n default:\n return;\n }\n};\n\nexport type BadgeProps = {\n children: ReactNode;\n showIcon?: boolean;\n variant: BadgeVariant;\n [\"data-testid\"]?: string;\n allyLabel?: string;\n className?: string;\n};\n\nexport const Badge = ({\n children,\n showIcon = true,\n variant,\n [\"data-testid\"]: dataTestid,\n allyLabel,\n className = \"\",\n ...props\n}: BadgeProps) => {\n const icon = getIcon(variant);\n\n const classes = c([className, styles[rootClassName], styles[`${rootClassName}--${variant}`]]);\n\n return (\n <span aria-label={allyLabel} className={classes} data-testid={dataTestid} {...props}>\n {showIcon && icon && (\n <Icon data-testid={`${dataTestid}-icon`} allyTitle={allyLabel} size=\"xs\" svg={icon} />\n )}\n {children}\n </span>\n );\n};\n"],"names":["a","r","p","e","s","t","n","o","i","u","m","f","_","d","c","v","x","g","h","b","l","hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","rootClassName","BADGE_VARIANT","badgeVariants","getIcon","variant","offering","info","checkCircle","alert","error","question","tag","Badge","children","showIcon","dataTestid","allyLabel","className","props","icon","styles","jsxs","jsx","Icon"],"mappings":";AACA,SAASA,EAAEC,GAAG;AACZ,SAAOA,KAAKA,EAAE,cAAc,OAAO,UAAU,eAAe,KAAKA,GAAG,SAAS,IAAIA,EAAE,UAAUA;AAC/F;AACA,IAAIC,IAAI,EAAE,SAAS,GAAI;AACvB;AAAA;AAAA;AAAA;AAAA;AAAA,CAKC,SAASD,GAAG;AACX,GAAC,WAAW;AACV,QAAIE,IAAI,CAAA,EAAG;AACX,aAASC,IAAI;AACX,eAASC,IAAI,IAAIC,IAAI,GAAGA,IAAI,UAAU,QAAQA,KAAK;AACjD,YAAIC,IAAI,UAAUD,CAAC;AACnB,QAAAC,MAAMF,IAAIG,EAAEH,GAAGI,EAAE,KAAK,MAAMF,CAAC,CAAC;AAAA,MACtC;AACM,aAAOF;AAAA,IACb;AACI,aAASI,EAAEJ,GAAG;AACZ,UAAI,OAAOA,KAAK,YAAY,OAAOA,KAAK;AACtC,eAAO,QAAQ,KAAKA,CAAC,KAAKA;AAC5B,UAAI,OAAOA,KAAK;AACd,eAAO;AACT,UAAI,MAAM,QAAQA,CAAC;AACjB,eAAOD,EAAE,MAAM,MAAMC,CAAC;AACxB,UAAIA,EAAE,aAAa,OAAO,UAAU,YAAY,CAACA,EAAE,SAAS,WAAW,SAAS,eAAe;AAC7F,eAAOA,EAAE,SAAU;AACrB,UAAIC,IAAI;AACR,eAASC,KAAKF;AACZ,QAAAF,EAAE,KAAKE,GAAGE,CAAC,KAAKF,EAAEE,CAAC,MAAMD,IAAIE,EAAEF,GAAG,QAAQ,KAAKC,CAAC,KAAKA,CAAC;AACxD,aAAOD;AAAA,IACb;AACI,aAASE,EAAEH,GAAGC,GAAG;AACf,aAAOA,IAAID,IAAIA,IAAI,MAAMC,IAAID,IAAIC,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ACV,aAAAO;AAAAA,IACT,KAAKP,EAAc;AACV,aAAAQ;AAAAA,IACT,KAAKR,EAAc;AACV,aAAAS;AAAAA,IACT,KAAKT,EAAc;AACV,aAAAU;AAAAA,IACT;AACE;AAAA,EAAA;AAEN,GAWaC,IAAQ,CAAC;AAAA,EACpB,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAV;AAAA,EACA,CAAC,gBAAgBW;AAAA,EACjB,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAkB;AACV,QAAAC,IAAOhB,EAAQC,CAAO,GAEtBZ,IAAUT,EAAE,CAACkC,GAAWG,EAAOpB,CAAa,GAAGoB,EAAO,GAAGpB,CAAa,KAAKI,CAAO,EAAE,CAAC,CAAC;AAG1F,SAAA,gBAAAiB,EAAC,UAAK,cAAYL,GAAW,WAAWxB,GAAS,eAAauB,GAAa,GAAGG,GAC3E,UAAA;AAAA,IAAAJ,KAAYK,KACX,gBAAAG,EAACC,GAAK,EAAA,eAAa,GAAGR,CAAU,SAAS,WAAWC,GAAW,MAAK,MAAK,KAAKG,GAAM;AAAA,IAErFN;AAAA,EAAA,GACH;AAEJ;","x_google_ignoreList":[8]}
|
|
1
|
+
{"version":3,"file":"badge.es.js","sources":["../../icon/dist/icon.es.js","../../icon/dist/assets/alert.es.js","../../icon/dist/assets/check-circle.es.js","../../icon/dist/assets/error.es.js","../../icon/dist/assets/info.es.js","../../icon/dist/assets/offering.es.js","../../icon/dist/assets/question.es.js","../../icon/dist/assets/tag.es.js","../../../common/temp/node_modules/.pnpm/classnames@2.5.1/node_modules/classnames/index.js","../src/badge.tsx"],"sourcesContent":["import { jsx as a } from \"react/jsx-runtime\";\nfunction f(r) {\n return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, \"default\") ? r.default : r;\n}\nvar c = { exports: {} };\n/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\nvar p;\nfunction m() {\n return p || (p = 1, function(r) {\n (function() {\n var e = {}.hasOwnProperty;\n function s() {\n for (var t = \"\", n = 0; n < arguments.length; n++) {\n var o = arguments[n];\n o && (t = i(t, u.call(this, o)));\n }\n return t;\n }\n function u(t) {\n if (typeof t == \"string\" || typeof t == \"number\")\n return this && this[t] || t;\n if (typeof t != \"object\")\n return \"\";\n if (Array.isArray(t))\n return s.apply(this, t);\n if (t.toString !== Object.prototype.toString && !t.toString.toString().includes(\"[native code]\"))\n return t.toString();\n var n = \"\";\n for (var o in t)\n e.call(t, o) && t[o] && (n = i(n, this && this[o] || o));\n return n;\n }\n function i(t, n) {\n return n ? t ? t + \" \" + n : t + n : t;\n }\n r.exports ? (s.default = s, r.exports = s) : window.classNames = s;\n })();\n }(c)), c.exports;\n}\nvar _ = m();\nconst d = /* @__PURE__ */ f(_), v = {\n \"purpur-icon\": \"_purpur-icon_8u1lq_1\",\n \"purpur-icon--xxs\": \"_purpur-icon--xxs_8u1lq_4\",\n \"purpur-icon--xs\": \"_purpur-icon--xs_8u1lq_8\",\n \"purpur-icon--sm\": \"_purpur-icon--sm_8u1lq_12\",\n \"purpur-icon--md\": \"_purpur-icon--md_8u1lq_16\",\n \"purpur-icon--lg\": \"_purpur-icon--lg_8u1lq_20\",\n \"purpur-icon--xl\": \"_purpur-icon--xl_8u1lq_24\"\n}, x = d.bind(v), l = \"purpur-icon\", w = [\"xxs\", \"xs\", \"sm\", \"md\", \"lg\", \"xl\"], g = \"md\", h = (r) => r.filter((e) => Object.keys(e).length >= 1).map((e) => `${e.name}=\"${e.value}\"`).join(\" \"), b = ({ content: r = \"\", title: e } = {}) => {\n const s = [\n { name: \"xmlns\", value: \"http://www.w3.org/2000/svg\" },\n { name: \"fill\", value: \"currentColor\" },\n { name: \"viewBox\", value: \"0 0 24 24\" },\n e ? { name: \"role\", value: \"img\" } : { name: \"aria-hidden\", value: \"true\" }\n ], u = e ? `<title>${e}</title>` : \"\";\n return `<svg ${h(s)}>${u}${r}</svg>`;\n}, S = (r) => r.replace(/<(\\/?)svg([^>]*)>/g, \"\").trim(), y = ({\n [\"data-testid\"]: r,\n svg: e,\n allyTitle: s,\n className: u,\n size: i = g,\n ...t\n}) => {\n const n = b({\n content: S(e.svg),\n title: s\n }), o = x(u, l, `${l}--${i}`);\n return /* @__PURE__ */ a(\n \"span\",\n {\n \"aria-label\": s,\n className: o,\n \"data-testid\": r,\n dangerouslySetInnerHTML: { __html: n },\n ...t\n }\n );\n};\ny.displayName = \"Icon\";\nexport {\n g as DEFAULT_SIZE,\n y as Icon,\n w as sizes\n};\n//# sourceMappingURL=icon.es.js.map\n","const e = {\n name: \"alert\",\n 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>',\n keywords: [\"alert\"],\n category: \"status\"\n};\nexport {\n e as alert\n};\n//# sourceMappingURL=alert.es.js.map\n","const e = {\n name: \"check-circle\",\n 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>',\n keywords: [\"check-circle\"],\n category: \"status\"\n};\nexport {\n e as checkCircle\n};\n//# sourceMappingURL=check-circle.es.js.map\n","const l = {\n name: \"error\",\n 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>',\n keywords: [\"error\"],\n category: \"status\"\n};\nexport {\n l as error\n};\n//# sourceMappingURL=error.es.js.map\n","const o = {\n name: \"info\",\n 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>',\n keywords: [\"info\"],\n category: \"status\"\n};\nexport {\n o as info\n};\n//# sourceMappingURL=info.es.js.map\n","const a = {\n name: \"offering\",\n 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>',\n keywords: [\"offering\"],\n category: \"other\"\n};\nexport {\n a as offering\n};\n//# sourceMappingURL=offering.es.js.map\n","const e = {\n name: \"question\",\n 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>',\n keywords: [\"question\"],\n category: \"status\"\n};\nexport {\n e as question\n};\n//# sourceMappingURL=question.es.js.map\n","const l = {\n name: \"tag\",\n 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>',\n keywords: [\"tag\"],\n category: \"other\"\n};\nexport {\n l as tag\n};\n//# sourceMappingURL=tag.es.js.map\n","/*!\n\tCopyright (c) 2018 Jed Watson.\n\tLicensed under the MIT License (MIT), see\n\thttp://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames () {\n\t\tvar classes = '';\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (arg) {\n\t\t\t\tclasses = appendClass(classes, parseValue(arg));\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction parseValue (arg) {\n\t\tif (typeof arg === 'string' || typeof arg === 'number') {\n\t\t\treturn arg;\n\t\t}\n\n\t\tif (typeof arg !== 'object') {\n\t\t\treturn '';\n\t\t}\n\n\t\tif (Array.isArray(arg)) {\n\t\t\treturn classNames.apply(null, arg);\n\t\t}\n\n\t\tif (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes('[native code]')) {\n\t\t\treturn arg.toString();\n\t\t}\n\n\t\tvar classes = '';\n\n\t\tfor (var key in arg) {\n\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\tclasses = appendClass(classes, key);\n\t\t\t}\n\t\t}\n\n\t\treturn classes;\n\t}\n\n\tfunction appendClass (value, newClass) {\n\t\tif (!newClass) {\n\t\t\treturn value;\n\t\t}\n\t\n\t\tif (value) {\n\t\t\treturn value + ' ' + newClass;\n\t\t}\n\t\n\t\treturn value + newClass;\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","import React, { ReactNode } from \"react\";\nimport { Icon } from \"@purpurds/icon\";\nimport { alert } from \"@purpurds/icon/assets/alert\";\nimport { checkCircle } from \"@purpurds/icon/assets/check-circle\";\nimport { error } from \"@purpurds/icon/assets/error\";\nimport { info } from \"@purpurds/icon/assets/info\";\nimport { offering } from \"@purpurds/icon/assets/offering\";\nimport { question } from \"@purpurds/icon/assets/question\";\nimport { tag } from \"@purpurds/icon/assets/tag\";\nimport c from \"classnames\";\n\nimport styles from \"./badge.module.scss\";\nconst rootClassName = \"purpur-badge\";\n\nexport const BADGE_VARIANT = {\n ATTENTION: \"attention\",\n SPECIAL: \"special\",\n NEUTRAL: \"neutral\",\n INFORMATION: \"information\",\n SUCCESS: \"success\",\n WARNING: \"warning\",\n ERROR: \"error\",\n BLACK_FRIDAY: \"black-friday\",\n} as const;\n\nexport const badgeVariants = Object.values(BADGE_VARIANT);\nexport type BadgeVariant = (typeof BADGE_VARIANT)[keyof typeof BADGE_VARIANT];\n\nconst getIcon = (variant: BadgeVariant) => {\n switch (variant) {\n case BADGE_VARIANT.ATTENTION:\n case BADGE_VARIANT.SPECIAL:\n return offering;\n case BADGE_VARIANT.INFORMATION:\n return info;\n case BADGE_VARIANT.SUCCESS:\n return checkCircle;\n case BADGE_VARIANT.WARNING:\n return alert;\n case BADGE_VARIANT.ERROR:\n return error;\n case BADGE_VARIANT.NEUTRAL:\n return question;\n case BADGE_VARIANT.BLACK_FRIDAY:\n return tag;\n default:\n return;\n }\n};\n\nexport type BadgeProps = {\n children: ReactNode;\n showIcon?: boolean;\n variant: BadgeVariant;\n [\"data-testid\"]?: string;\n allyLabel?: string;\n className?: string;\n};\n\nexport const Badge = ({\n children,\n showIcon = true,\n variant,\n [\"data-testid\"]: dataTestid,\n allyLabel,\n className = \"\",\n ...props\n}: BadgeProps) => {\n const icon = getIcon(variant);\n\n const classes = c([className, styles[rootClassName], styles[`${rootClassName}--${variant}`]]);\n\n return (\n <span aria-label={allyLabel} className={classes} data-testid={dataTestid} {...props}>\n {showIcon && icon && (\n <Icon data-testid={`${dataTestid}-icon`} allyTitle={allyLabel} size=\"xs\" svg={icon} />\n )}\n {children}\n </span>\n );\n};\n"],"names":["f","r","c","m","e","s","t","n","o","i","_","d","v","x","l","g","h","b","S","y","a","hasOwn","classNames","classes","arg","appendClass","parseValue","key","value","newClass","module","rootClassName","BADGE_VARIANT","badgeVariants","getIcon","variant","offering","info","checkCircle","alert","error","question","tag","Badge","children","showIcon","dataTestid","allyLabel","className","props","icon","styles","jsxs","jsx","Icon"],"mappings":";AACA,SAASA,EAAEC,GAAG;AACZ,SAAOA,KAAKA,EAAE,cAAc,OAAO,UA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E;AAAA,EAAA;AAEN,GAWaC,IAAQ,CAAC;AAAA,EACpB,UAAAC;AAAA,EACA,UAAAC,IAAW;AAAA,EACX,SAAAV;AAAA,EACA,CAAC,gBAAgBW;AAAA,EACjB,WAAAC;AAAA,EACA,WAAAC,IAAY;AAAA,EACZ,GAAGC;AACL,MAAkB;AACV,QAAAC,IAAOhB,EAAQC,CAAO,GAEtBZ,IAAUrB,EAAE,CAAC8C,GAAWG,EAAOpB,CAAa,GAAGoB,EAAO,GAAGpB,CAAa,KAAKI,CAAO,EAAE,CAAC,CAAC;AAG1F,SAAA,gBAAAiB,EAAC,UAAK,cAAYL,GAAW,WAAWxB,GAAS,eAAauB,GAAa,GAAGG,GAC3E,UAAA;AAAA,IAAAJ,KAAYK,KACX,gBAAAG,EAACC,GAAK,EAAA,eAAa,GAAGR,CAAU,SAAS,WAAWC,GAAW,MAAK,MAAK,KAAKG,GAAM;AAAA,IAErFN;AAAA,EAAA,GACH;AAEJ;","x_google_ignoreList":[8]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/badge",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.1",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/badge.cjs.js",
|
|
6
6
|
"types": "./dist/badge.d.ts",
|
|
@@ -16,13 +16,13 @@
|
|
|
16
16
|
"source": "src/badge.tsx",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"classnames": "~2.5.0",
|
|
19
|
-
"@purpurds/
|
|
20
|
-
"@purpurds/
|
|
19
|
+
"@purpurds/tokens": "6.3.1",
|
|
20
|
+
"@purpurds/icon": "6.3.1"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@rushstack/eslint-patch": "~1.10.0",
|
|
24
|
-
"@storybook/react": "^8.
|
|
25
|
-
"storybook": "^8.
|
|
24
|
+
"@storybook/react": "^8.6.4",
|
|
25
|
+
"storybook": "^8.6.4",
|
|
26
26
|
"@telia/base-rig": "~8.2.0",
|
|
27
27
|
"@telia/react-rig": "~3.2.0",
|
|
28
28
|
"@testing-library/dom": "~10.4.0",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"react-dom": "^19.0.0",
|
|
40
40
|
"react": "^19.0.0",
|
|
41
41
|
"typescript": "^5.6.3",
|
|
42
|
-
"vite": "
|
|
42
|
+
"vite": "^6.2.1",
|
|
43
43
|
"vitest": "^2.1.2",
|
|
44
44
|
"@purpurds/component-rig": "1.0.0"
|
|
45
45
|
},
|