@purpurds/notification 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.
@@ -0,0 +1,26 @@
1
+ System.register(["react","react/jsx-runtime"],function(f,Lr){"use strict";var S,o,j,_;return{setters:[d=>{S=d.forwardRef,o=d.default},d=>{j=d.jsxs,_=d.jsx}],execute:function(){const d={SM:"sm",MD:"md",LG:"lg"};function V(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var R={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 i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(R);var k=R.exports;const L=V(k),F="_rotate_7s2g1_1",H="_dash_7s2g1_1",w={"purpur-spinner":"_purpur-spinner_7s2g1_1",rotate:F,"purpur-spinner--xxs":"_purpur-spinner--xxs_7s2g1_4","purpur-spinner--xs":"_purpur-spinner--xs_7s2g1_8","purpur-spinner--sm":"_purpur-spinner--sm_7s2g1_12","purpur-spinner--md":"_purpur-spinner--md_7s2g1_16","purpur-spinner--lg":"_purpur-spinner--lg_7s2g1_20","purpur-spinner__circle":"_purpur-spinner__circle_7s2g1_24",dash:H,"purpur-spinner__circle--disabled":"_purpur-spinner__circle--disabled_7s2g1_33","purpur-spinner__circle--negative":"_purpur-spinner__circle--negative_7s2g1_36","purpur-spinner__circle--negative-disabled":"_purpur-spinner__circle--negative-disabled_7s2g1_39"},x="purpur-spinner",z={PRIMARY:"primary",DISABLED:"disabled",NEGATIVE:"negative",NEGATIVE_DISABLED:"negative-disabled"},U={XXS:"xxs",XS:"xs",SM:"sm",MD:"md",LG:"lg"},W=({["data-testid"]:e,size:i=U.SM,variant:a=z.PRIMARY,...u})=>_("div",{className:L([w[x],w[`${x}--${i}`]]),"data-testid":e,...u,children:_("svg",{viewBox:"0 0 50 50",children:_("circle",{className:L(w[`${x}__circle`],w[`${x}__circle--${a}`]),cx:"25",cy:"25",r:"20"})})});function X(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var T={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 i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(T);var Y=T.exports;const K=X(Y),g={"purpur-button":"_purpur-button_1fna2_1","purpur-button--sm":"_purpur-button--sm_1fna2_33","purpur-button--icon-only":"_purpur-button--icon-only_1fna2_36","purpur-button--md":"_purpur-button--md_1fna2_39","purpur-button--lg":"_purpur-button--lg_1fna2_45","purpur-button--full-width":"_purpur-button--full-width_1fna2_51","purpur-button--primary":"_purpur-button--primary_1fna2_54","purpur-button--disabled":"_purpur-button--disabled_1fna2_58","purpur-button--primary-negative":"_purpur-button--primary-negative_1fna2_64","purpur-button--secondary":"_purpur-button--secondary_1fna2_76","purpur-button--secondary-negative":"_purpur-button--secondary-negative_1fna2_87","purpur-button--expressive":"_purpur-button--expressive_1fna2_98","purpur-button--expressive-negative":"_purpur-button--expressive-negative_1fna2_108","purpur-button--negative":"_purpur-button--negative_1fna2_120","purpur-button--destructive":"_purpur-button--destructive_1fna2_127","purpur-button--destructive-negative":"_purpur-button--destructive-negative_1fna2_137","purpur-button--tertiary-purple":"_purpur-button--tertiary-purple_1fna2_147","purpur-button--tertiary-purple-negative":"_purpur-button--tertiary-purple-negative_1fna2_160","purpur-button--text-negative":"_purpur-button--text-negative_1fna2_175","purpur-button--text":"_purpur-button--text_1fna2_175"},h="purpur-button",J=({children:e,className:i,["data-testid"]:a,disabled:u=!1,fullWidth:p=!1,iconOnly:r,loading:t=!1,onClick:n,size:v=d.MD,variant:y,type:s="button",...m},E)=>{if(r&&y==="destructive")return null;const I=K([g[h],g[`${h}--${y}`],g[`${h}--${v}`]],{[g[`${h}--icon-only`]]:r,[g[`${h}--negative`]]:y.endsWith("negative"),[g[`${h}--full-width`]]:p,[g[`${h}--disabled`]]:u||t},i),jr=Z=>{u||t?Z.preventDefault():n&&n(Z)},Rr=()=>y.endsWith("negative")?"negative-disabled":"disabled";return j("button",{className:I,"data-testid":a,type:s,ref:E,"aria-disabled":m["aria-disabled"]||u||t,onClick:jr,...m,children:[t&&_(W,{size:v===d.LG?"xs":"xxs",variant:Rr()})," ",e]})},M=S(J);M.displayName="Button";function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var P={exports:{}};/*!
10
+ Copyright (c) 2018 Jed Watson.
11
+ Licensed under the MIT License (MIT), see
12
+ http://jedwatson.github.io/classnames
13
+ */(function(e){(function(){var i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(P);var rr=P.exports;const tr=Q(rr),O={"purpur-heading":"_purpur-heading_2c2y0_1","purpur-heading--hyphens":"_purpur-heading--hyphens_2c2y0_8","purpur-heading--subsection-100":"_purpur-heading--subsection-100_2c2y0_11","purpur-heading--title-100":"_purpur-heading--title-100_2c2y0_17","purpur-heading--title-200":"_purpur-heading--title-200_2c2y0_23","purpur-heading--title-300":"_purpur-heading--title-300_2c2y0_29","purpur-heading--title-400":"_purpur-heading--title-400_2c2y0_35","purpur-heading--title-500":"_purpur-heading--title-500_2c2y0_41","purpur-heading--title-600":"_purpur-heading--title-600_2c2y0_47","purpur-heading--title-700":"_purpur-heading--title-700_2c2y0_53","purpur-heading--display-25":"_purpur-heading--display-25_2c2y0_59","purpur-heading--display-50":"_purpur-heading--display-50_2c2y0_65","purpur-heading--display-100":"_purpur-heading--display-100_2c2y0_71","purpur-heading--display-200":"_purpur-heading--display-200_2c2y0_77"},er={TITLE100:"title-100",TITLE200:"title-200",TITLE300:"title-300",TITLE400:"title-400",TITLE500:"title-500",TITLE600:"title-600",TITLE700:"title-700",SUBSECTION100:"subsection-100"},N="purpur-heading",nr=({["data-testid"]:e,children:i,className:a="",enableHyphenation:u=!1,tag:p,variant:r=er.TITLE100,...t})=>{const n=p,v=tr([a,O[N],O[`${N}--${r}`],{[O[`${N}--hyphens`]]:u}]);return _(n,{...t,className:v,"data-testid":e,children:i})};function ar(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var C={exports:{}};/*!
14
+ Copyright (c) 2018 Jed Watson.
15
+ Licensed under the MIT License (MIT), see
16
+ http://jedwatson.github.io/classnames
17
+ */(function(e){(function(){var i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,this&&this[n]||n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(C);var ir=C.exports;const ur=ar(ir),pr={"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"},or={name:"alert-filled",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm1.038-14.81-.247 6.875h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.916c0 .649-.585 1.234-1.25 1.234-.649 0-1.25-.585-1.25-1.234 0-.633.601-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',keywords:["alert-filled"],category:"status"},sr={name:"check-circle-filled",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10Zm4.712-12.491a.875.875 0 1 0-1.424-1.018l-4.4 6.16-2.27-2.27a.875.875 0 0 0-1.237 1.238l3 3a.875.875 0 0 0 1.331-.11l5-7Z" clip-rule="evenodd"/></svg>',keywords:["check-circle-filled"],category:"status"},lr={name:"close",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M4.864 4.864a.9.9 0 0 1 1.273 0L12 10.727l5.864-5.863a.9.9 0 0 1 1.272 1.272L13.273 12l5.863 5.864a.9.9 0 1 1-1.272 1.272L12 13.273l-5.863 5.863a.9.9 0 0 1-1.273-1.272L10.727 12 4.864 6.136a.9.9 0 0 1 0-1.272Z" clip-rule="evenodd"/></svg>',keywords:["close"],category:"utility"},cr={name:"error-filled",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" d="M14.268 3.5c-.77-1.333-2.694-1.333-3.464 0l-8.66 15c-.77 1.333.192 3 1.732 3h17.32c1.54 0 2.502-1.667 1.733-3l-8.66-15Zm-.694 5.067-.247 6.876h-1.566l-.247-6.876a1.03 1.03 0 1 1 2.06 0Zm.212 8.917c0 .649-.585 1.234-1.25 1.234-.648 0-1.25-.585-1.25-1.234 0-.633.602-1.234 1.25-1.234.665 0 1.25.601 1.25 1.234Z" clip-rule="evenodd"/></svg>',keywords:["error-filled"],category:"status"},_r={name:"info-filled",svg:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path fill-rule="evenodd" d="M12 22c5.523 0 10-4.477 10-10S17.523 2 12 2 2 6.477 2 12s4.477 10 10 10ZM10.9 7.786c0 .591.516 1.077 1.108 1.077.576 0 1.092-.486 1.092-1.077 0-.592-.516-1.078-1.092-1.078-.592 0-1.108.486-1.108 1.078Zm.167 9.74h1.866V9.94h-1.866v7.586Z" clip-rule="evenodd"/></svg>',keywords:["info-filled"],category:"status"},dr=ur.bind(pr),q="purpur-icon",fr="md",gr=e=>e.filter(i=>Object.keys(i).length>=1).map(i=>`${i.name}="${i.value}"`).join(" "),hr=({content:e="",title:i}={})=>{const a=[{name:"xmlns",value:"http://www.w3.org/2000/svg"},{name:"fill",value:"currentColor"},{name:"viewBox",value:"0 0 24 24"},i?{name:"role",value:"img"}:{name:"aria-hidden",value:"true"}],u=i?`<title>${i}</title>`:"";return`<svg ${gr(a)}>${u}${e}</svg>`},vr=e=>e.replace(/<(\/?)svg([^>]*)>/g,"").trim(),D=({["data-testid"]:e,svg:i,allyTitle:a,className:u="",size:p=fr,...r})=>{const t=hr({content:vr(i.svg),title:a}),n=dr(u,q,`${q}--${p}`);return _("span",{"aria-label":a,className:n,"data-testid":e,dangerouslySetInnerHTML:{__html:t},...r})};function yr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var B={exports:{}};/*!
18
+ Copyright (c) 2018 Jed Watson.
19
+ Licensed under the MIT License (MIT), see
20
+ http://jedwatson.github.io/classnames
21
+ */(function(e){(function(){var i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(B);var mr=B.exports;const br=yr(mr),$={"purpur-paragraph":"_purpur-paragraph_hwaj6_1","purpur-paragraph--disabled":"_purpur-paragraph--disabled_hwaj6_7","purpur-paragraph--hyphens":"_purpur-paragraph--hyphens_hwaj6_10","purpur-paragraph--paragraph-100":"_purpur-paragraph--paragraph-100_hwaj6_13","purpur-paragraph--paragraph-100-medium":"_purpur-paragraph--paragraph-100-medium_hwaj6_19","purpur-paragraph--paragraph-100-bold":"_purpur-paragraph--paragraph-100-bold_hwaj6_26","purpur-paragraph--paragraph-200":"_purpur-paragraph--paragraph-200_hwaj6_33","purpur-paragraph--preamble-100":"_purpur-paragraph--preamble-100_hwaj6_39","purpur-paragraph--preamble-200":"_purpur-paragraph--preamble-200_hwaj6_45","purpur-paragraph--additional-100":"_purpur-paragraph--additional-100_hwaj6_51","purpur-paragraph--additional-100-medium":"_purpur-paragraph--additional-100-medium_hwaj6_57","purpur-paragraph--overline-100":"_purpur-paragraph--overline-100_hwaj6_64","purpur-paragraph--overline-200":"_purpur-paragraph--overline-200_hwaj6_71"},wr={PARAGRAPH100:"paragraph-100",PARAGRAPH100MEDIUM:"paragraph-100-medium",PARAGRAPH100BOLD:"paragraph-100-bold",PARAGRAPH200:"paragraph-200",PREAMBLE100:"preamble-100",PREAMBLE200:"preamble-200",ADDITIONAL100:"additional-100",ADDITIONAL100MEDIUM:"additional-100-medium",OVERLINE100:"overline-100",OVERLINE200:"overline-200"},A="purpur-paragraph",xr=({["data-testid"]:e,children:i,className:a="",disabled:u,enableHyphenation:p=!1,variant:r=wr.PARAGRAPH100,...t})=>{const n=br([a,$[A],$[`${A}--${r}`],{[$[`${A}--hyphens`]]:p,[$[`${A}--disabled`]]:u}]);return _("p",{...t,className:n,"data-testid":e,children:i})};function $r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var G={exports:{}};/*!
22
+ Copyright (c) 2018 Jed Watson.
23
+ Licensed under the MIT License (MIT), see
24
+ http://jedwatson.github.io/classnames
25
+ */(function(e){(function(){var i={}.hasOwnProperty;function a(){for(var r="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(r=p(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)i.call(r,n)&&r[n]&&(t=p(t,n));return t}function p(r,t){return t?r?r+" "+t:r+t:r}e.exports?(a.default=a,e.exports=a):window.classNames=a})()})(G);var Ar=G.exports;const Sr=$r(Ar),l={"purpur-notification":"_purpur-notification_10qwf_1","purpur-notification__top":"_purpur-notification__top_10qwf_14","purpur-notification__header":"_purpur-notification__header_10qwf_20","purpur-notification__close-button":"_purpur-notification__close-button_10qwf_25","purpur-notification__icon":"_purpur-notification__icon_10qwf_30","purpur-notification__body":"_purpur-notification__body_10qwf_33","purpur-notification--success":"_purpur-notification--success_10qwf_36","purpur-notification__heading":"_purpur-notification__heading_10qwf_39","purpur-notification--warning":"_purpur-notification--warning_10qwf_45","purpur-notification--error":"_purpur-notification--error_10qwf_54","purpur-notification--info":"_purpur-notification--info_10qwf_63","purpur-notification--hidden":"_purpur-notification--hidden_10qwf_72","purpur-notification--has-close-button":"_purpur-notification--has-close-button_10qwf_76"},b=f("NOTIFICATION_STATUS",{SUCCESS:"success",WARNING:"warning",ERROR:"error",INFO:"info"}),Tr=f("notificationStatuses",Object.values(b)),Or=f("NOTIFICATION_ARIA_LIVE",{POLITE:"polite",ASSERTIVE:"assertive"}),Mr=f("notificationAriaLiveValues",Object.values(Or)),Nr=f("NOTIFICATION_ROLE",{ALERT:"alert",DIALOG:"dialog",ALERTDIALOG:"alertdialog"}),Pr=f("notificationRoles",Object.values(Nr)),c="purpur-notification",Er=e=>{switch(e){case b.INFO:return _r;case b.SUCCESS:return sr;case b.WARNING:return or;case b.ERROR:return cr}},Ir=f("Notification",S(({["data-testid"]:e,["aria-live"]:i,children:a,className:u,closeButtonAllyLabel:p,headingTag:r="h4",role:t,status:n="info",heading:v,hidden:y,id:s,onClose:m,...E},I)=>o.createElement("div",{id:s,"aria-labelledby":s?`${s}-heading`:void 0,"aria-describedby":s?`${s}-body`:void 0,"aria-live":i,"aria-hidden":!!y,className:Sr(u,l[c],l[`${c}--${n}`],{[l[`${c}--hidden`]]:y,[l[`${c}--has-close-button`]]:!!m}),"data-testid":e,ref:I,role:t,...E},o.createElement("div",{className:l[`${c}__top`]},o.createElement("div",{className:l[`${c}__header`]},o.createElement(D,{"data-testid":e?`${e}-icon`:void 0,className:l[`${c}__icon`],svg:Er(n),size:"md"}),!!v&&o.createElement(nr,{"data-testid":e?`${e}-heading`:void 0,variant:"subsection-100",tag:r,className:l[`${c}__heading`]},o.createElement("span",{id:s?`${s}-heading`:void 0}," ",v))),m&&o.createElement(M,{"data-testid":e?`${e}-close-button`:void 0,variant:"tertiary-purple",size:"sm",iconOnly:!0,"aria-label":p,onClick:m,className:l[`${c}__close-button`]},o.createElement(D,{svg:lr,size:"sm"}))),a&&o.createElement("div",{"data-testid":e?`${e}-body`:void 0,className:l[`${c}__body`],id:s?`${s}-body`:void 0},typeof a=="string"?o.createElement(xr,{"data-testid":e?`${e}-paragraph`:void 0,variant:"paragraph-100"},a):a))));Ir.displayName="Notification"}}});
26
+ //# sourceMappingURL=notification.system.js.map