@purpurds/badge 3.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 +38 -0
- package/dist/badge.cjs.js +10 -0
- package/dist/badge.cjs.js.map +1 -0
- package/dist/badge.d.ts +22 -0
- package/dist/badge.d.ts.map +1 -0
- package/dist/badge.es.js +184 -0
- package/dist/badge.es.js.map +1 -0
- package/dist/badge.system.js +10 -0
- package/dist/badge.system.js.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +60 -0
- package/readme.mdx +56 -0
- package/src/badge.module.scss +49 -0
- package/src/badge.stories.tsx +29 -0
- package/src/badge.test.tsx +55 -0
- package/src/badge.tsx +64 -0
- package/src/global.d.ts +4 -0
package/dist/LICENSE.txt
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
Name: @purpurds/icon
|
|
2
|
+
Version: 2.8.0
|
|
3
|
+
License: AGPL-3.0-only
|
|
4
|
+
Private: false
|
|
5
|
+
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
Name: classnames
|
|
9
|
+
Version: 2.5.1
|
|
10
|
+
License: MIT
|
|
11
|
+
Private: false
|
|
12
|
+
Description: A simple utility for conditionally joining classNames together
|
|
13
|
+
Repository: git+https://github.com/JedWatson/classnames.git
|
|
14
|
+
Author: Jed Watson
|
|
15
|
+
License Copyright:
|
|
16
|
+
===
|
|
17
|
+
|
|
18
|
+
The MIT License (MIT)
|
|
19
|
+
|
|
20
|
+
Copyright (c) 2018 Jed Watson
|
|
21
|
+
|
|
22
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
23
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
24
|
+
in the Software without restriction, including without limitation the rights
|
|
25
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
26
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
27
|
+
furnished to do so, subject to the following conditions:
|
|
28
|
+
|
|
29
|
+
The above copyright notice and this permission notice shall be included in all
|
|
30
|
+
copies or substantial portions of the Software.
|
|
31
|
+
|
|
32
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
33
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
34
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
35
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
36
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
37
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
38
|
+
SOFTWARE.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime");function _(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var g={exports:{}};/*!
|
|
2
|
+
Copyright (c) 2018 Jed Watson.
|
|
3
|
+
Licensed under the MIT License (MIT), see
|
|
4
|
+
http://jedwatson.github.io/classnames
|
|
5
|
+
*/(function(e){(function(){var a={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=o(r,s.call(this,u)))}return r}function s(r){if(typeof r=="string"||typeof r=="number")return this&&this[r]||r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(this,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)a.call(r,u)&&r[u]&&(t=o(t,this&&this[u]||u));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(g);var m=g.exports;const h=_(m),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"},w={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"},b={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"},x={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"},S=h.bind(y),p="purpur-icon",N="md",A=e=>e.filter(a=>Object.keys(a).length>=1).map(a=>`${a.name}="${a.value}"`).join(" "),O=({content:e="",title:a}={})=>{const n=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},a?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],s=a?`<title>${a}</title>`:"";return`<svg ${A(n)}>${s}${e}</svg>`},Z=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),j=({["data-testid"]:e,svg:a,allyTitle:n,className:s="",size:o=N,...r})=>{const t=O({content:Z(a.svg),title:n}),u=S(s,p,`${p}--${o}`);return i.jsx("span",{"aria-label":n,className:u,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};function k(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var f={exports:{}};/*!
|
|
6
|
+
Copyright (c) 2018 Jed Watson.
|
|
7
|
+
Licensed under the MIT License (MIT), see
|
|
8
|
+
http://jedwatson.github.io/classnames
|
|
9
|
+
*/(function(e){(function(){var a={}.hasOwnProperty;function n(){for(var r="",t=0;t<arguments.length;t++){var u=arguments[t];u&&(r=o(r,s(u)))}return r}function s(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return n.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var t="";for(var u in r)a.call(r,u)&&r[u]&&(t=o(t,u));return t}function o(r,t){return t?r?r+" "+t:r+t:r}e.exports?(n.default=n,e.exports=n):window.classNames=n})()})(f);var R=f.exports;const M=k(R),c={"purpur-badge":"_purpur-badge_yhork_1","purpur-badge--attention":"_purpur-badge--attention_yhork_13","purpur-badge--special":"_purpur-badge--special_yhork_17","purpur-badge--neutral":"_purpur-badge--neutral_yhork_21","purpur-badge--information":"_purpur-badge--information_yhork_25","purpur-badge--success":"_purpur-badge--success_yhork_29","purpur-badge--warning":"_purpur-badge--warning_yhork_33","purpur-badge--error":"_purpur-badge--error_yhork_37"},d="purpur-badge",l={ATTENTION:"attention",SPECIAL:"special",NEUTRAL:"neutral",INFORMATION:"information",SUCCESS:"success",WARNING:"warning",ERROR:"error"},C=Object.values(l),E=e=>{switch(e){case l.SUCCESS:return b;case l.WARNING:return w;case l.ERROR:return x;default:return}},I=({children:e,showIcon:a=!0,variant:n,["data-testid"]:s,allyLabel:o,className:r="",...t})=>{const u=E(n),v=M([r,c[d],c[`${d}--${n}`]]);return i.jsxs("span",{"aria-label":o,className:v,"data-testid":s,...t,children:[a&&u&&i.jsx(j,{"data-testid":`${s}-icon`,allyTitle:o,size:"xs",svg:u}),e]})};exports.BADGE_VARIANT=l;exports.Badge=I;exports.badgeVariants=C;
|
|
10
|
+
//# sourceMappingURL=badge.cjs.js.map
|