UNPKG

@salesforce-ux/design-system

Version:
1 lines 7.4 kB
var SLDS=SLDS||{};SLDS["__internal/chunked/docs/ui/components/alert/docs.mdx.js"]=function(e){function t(t){for(var l,s,o=t[0],i=t[1],c=t[2],u=0,d=[];u<o.length;u++)s=o[u],r[s]&&d.push(r[s][0]),r[s]=0;for(l in i)Object.prototype.hasOwnProperty.call(i,l)&&(e[l]=i[l]);for(m&&m(t);d.length;)d.shift()();return n.push.apply(n,c||[]),a()}function a(){for(var e,t=0;t<n.length;t++){for(var a=n[t],l=!0,o=1;o<a.length;o++){var i=a[o];0!==r[i]&&(l=!1)}l&&(n.splice(t--,1),e=s(s.s=a[0]))}return e}var l={},r={3:0},n=[];function s(t){if(l[t])return l[t].exports;var a=l[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,s),a.l=!0,a.exports}s.m=e,s.c=l,s.d=function(e,t,a){s.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},s.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},s.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="/assets/scripts/bundle/";var o=this.webpackJsonpSLDS___internal_chunked_docs=this.webpackJsonpSLDS___internal_chunked_docs||[],i=o.push.bind(o);o.push=t,o=o.slice();for(var c=0;c<o.length;c++)t(o[c]);var m=i;return n.push([84,0]),a()}({0:function(e,t){e.exports=React},6:function(e,t){e.exports=JSBeautify},83:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.states=t.Alert=void 0;var l=o(a(0)),r=o(a(3)),n=a(8),s=o(a(1));function o(e){return e&&e.__esModule?e:{default:e}}var i=t.Alert=function(e){var t=e.className,a=e.type,n=e.children;return l.default.createElement("div",{className:(0,s.default)("slds-notify slds-notify_alert slds-theme_alert-texture",t,a?"slds-theme_"+a:null),role:"alert"},l.default.createElement("span",{className:"slds-assistive-text"},a||"info"),n,l.default.createElement("div",{className:"slds-notify__close"},l.default.createElement(r.default,{className:(0,s.default)("warning"!==a&&"slds-button_icon-inverse"),symbol:"close",assistiveText:"Close",title:"Close",size:"small"})))};t.default=l.default.createElement(i,{type:"info"},l.default.createElement(n.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"user"}),l.default.createElement("h2",null,"Logged in as John Smith (johnsmith@acme.com)."," ",l.default.createElement("a",{href:"javascript:void(0);"},"Log out")));t.states=[{id:"warning",label:"Warning",element:l.default.createElement(i,{type:"warning"},l.default.createElement(n.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"warning"}),l.default.createElement("h2",null,"Your browser is outdated. Your Salesforce experience may be degraded."," ",l.default.createElement("a",{href:"javascript:void(0);"},"More Information")))},{id:"error",label:"Error",element:l.default.createElement(i,{type:"error"},l.default.createElement(n.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"error"}),l.default.createElement("h2",null,"Your browser is currently not supported. Your Salesforce may be degraded. ",l.default.createElement("a",{href:"javascript:void(0);"},"More Information")))},{id:"offline",label:"Offline",element:l.default.createElement(i,{type:"offline"},l.default.createElement(n.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"offline"}),l.default.createElement("h2",null,"You are in offline mode."," ",l.default.createElement("a",{href:"javascript:void(0);"},"More Information")))}]},84:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContents=t.getElement=void 0;var l=a(0),r=(d(l),a(7)),n=d(r),s=d(a(9)),o=d(a(11)),i=d(a(10)),c=a(83),m=(d(a(3)),a(8)),u=d(a(12));function d(e){return e&&e.__esModule?e:{default:e}}var f=r.factories.h2,h=r.factories.p,p=t.getElement=function(){return(0,l.createElement)(n.default,{},(0,l.createElement)("div",{className:"lead"},"Alert banners communicate a state that affects the entire system, not just a feature or page. It persists over a session and appears without the user initiating the action."),f({id:"DefaultInfo-Alert"},"Default/Info Alert"),h({},"Use the info alert when notifying the user of neutral information about the system."),(0,l.createElement)(i.default,{title:"Alert Informational"},(0,l.createElement)(s.default,null,(0,l.createElement)(c.Alert,{type:"info"},(0,l.createElement)(m.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"user"}),(0,l.createElement)("h2",null,"Logged in as John Smith (johnsmith@acme.com)."," ",(0,l.createElement)("a",{href:"javascript:void(0);"},"Log out"))))),(0,l.createElement)(u.default,{type:"a11y",header:"Accessible Role"},"Alert notifications should contain ",(0,l.createElement)("code",{className:"doc"},'role="alert"')," on the container to signal to assistive technology that they require the user’s immediate attention."),(0,l.createElement)(o.default,{toggleCode:!1},(0,l.createElement)("div",{className:"slds-notify slds-notify_alert slds-theme_alert-texture slds-theme_info",role:"alert"},"...")),(0,l.createElement)(u.default,{type:"a11y",header:"Accessibility Note"},"Use a span with the class ",(0,l.createElement)("code",{className:"doc"},".slds-assistive-text")," to let the user know what type of notification it is"),(0,l.createElement)(o.default,{toggleCode:!1},(0,l.createElement)("span",{className:"slds-assistive-text"},"Info")),f({id:"Warning-Alert"},"Warning Alert"),h({},"Use the warning variant to warn the user about important system information that deserves caution."),(0,l.createElement)(i.default,{title:"Alert Warning"},(0,l.createElement)(s.default,null,(0,l.createElement)(c.Alert,{type:"warning"},(0,l.createElement)(m.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"warning"}),(0,l.createElement)("h2",null,"Your browser is outdated. Your Salesforce experience may be degraded."," ",(0,l.createElement)("a",{href:"javascript:void(0);"},"More Information"))))),f({id:"Error-Alert"},"Error Alert"),h({},"Use the error variant when you need to alert the user about an error in the system that needs immediate attention."),(0,l.createElement)(i.default,{title:"Alert Error"},(0,l.createElement)(s.default,null,(0,l.createElement)(c.Alert,{type:"error"},(0,l.createElement)(m.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"error"}),(0,l.createElement)("h2",null,"Your browser is currently not supported. Your Salesforce may be degraded. ",(0,l.createElement)("a",{href:"javascript:void(0);"},"More Information"))))),f({id:"Offline-Alert"},"Offline Alert"),h({},"Use the offline alert to let the user know that they are not connected to the internet."),(0,l.createElement)(i.default,{title:"Alert Offline"},(0,l.createElement)(s.default,null,(0,l.createElement)(c.Alert,{type:"offline"},(0,l.createElement)(m.UtilityIcon,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"offline"}),(0,l.createElement)("h2",null,"You are in offline mode."," ",(0,l.createElement)("a",{href:"javascript:void(0);"},"More Information"))))))};t.getContents=function(){return(0,r.createTableOfContents)(p())}}});