@salesforce-ux/design-system
Version:
Salesforce Lightning Design System
1 lines • 8.49 kB
JavaScript
var SLDS;!function(){"use strict";var e,t,n,r={1594:function(e){e.exports=React},1981:function(e){e.exports=JSBeautify},5206:function(e){e.exports=ReactDOM},8996:function(e,t,n){n.r(t),n.d(t,{getContents:function(){return T},getElement:function(){return S}});var r=n(1594),l=n.n(r),a=n(5671),s=n(6547),o=n(3212),i=(n(1374),n(6955)),c=n(538),m=(n(5619),n(806)),f=n(8342),u=n(7412),d=n.n(u),h=n(942),y=n.n(h),g=function(e){var t=e.type,n=e.children,r=e.isLegacy,a=y()("warning"===t&&"slds-alert_warning","error"===t&&"slds-alert_error","offline"===t&&"slds-alert_offline"),s=y()(r&&"slds-theme_alert-texture","info"===t&&r&&"slds-theme_info","warning"===t&&r&&"slds-theme_warning","error"===t&&r&&"slds-theme_error","offline"===t&&r&&"slds-theme_offline");return l().createElement("div",{className:y()("slds-notify slds-notify_alert",a,s),role:"alert"},l().createElement("span",{className:"slds-assistive-text"},t),n,l().createElement("div",{className:"slds-notify__close"},l().createElement(i.A,{className:y()("warning"!==t&&"slds-button_icon-inverse"),symbol:"close",assistiveText:"Close",title:"Close",size:"small"})))};g.propTypes={type:d().oneOf(["info","warning","error","offline"]),children:d().node,isLegacy:d().bool},g.defaultProps={type:"info"};var p=g,v=n(6515),b=n(9214),E=[{id:"default",label:"Default",element:l().createElement(p,null,l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"user"}),l().createElement(b.A,{level:"2"},"Logged in as John Smith (johnsmith@acme.com). ",l().createElement(v.A,null,"Log out")))}],_=[{id:"theme-info",label:"Default (Theme Class - Deprecated)",element:l().createElement(p,{isLegacy:!0},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"user"}),l().createElement(b.A,{level:"2"},"Logged in as John Smith (johnsmith@acme.com). ",l().createElement(v.A,null,"Log out")))},{id:"warning",label:"Warning",element:l().createElement(p,{type:"warning"},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"warning"}),l().createElement(b.A,{level:"2"},"Your browser is outdated. Your Salesforce experience may be degraded."," ",l().createElement(v.A,null,"More Information")))},{id:"theme-warning",label:"Warning (Theme Class - Deprecated)",element:l().createElement(p,{type:"warning",isLegacy:!0},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"warning"}),l().createElement(b.A,{level:"2"},"Your browser is outdated. Your Salesforce experience may be degraded."," ",l().createElement(v.A,null,"More Information")))},{id:"error",label:"Error",element:l().createElement(p,{type:"error"},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"error"}),l().createElement(b.A,{level:"2"},"Your browser is currently not supported. Your Salesforce may be degraded."," ",l().createElement(v.A,null,"More Information")))},{id:"theme-error",label:"Error (Theme Class - Deprecated)",element:l().createElement(p,{type:"error",isLegacy:!0},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"error"}),l().createElement(b.A,{level:"2"},"Your browser is currently not supported. Your Salesforce may be degraded."," ",l().createElement(v.A,null,"More Information")))},{id:"offline",label:"Offline",element:l().createElement(p,{type:"offline"},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"offline"}),l().createElement(b.A,{level:"2"},"You are in offline mode. ",l().createElement(v.A,null,"More Information")))},{id:"theme-offline",label:"Offline (Theme Class - Deprecated)",element:l().createElement(p,{type:"offline",isLegacy:!0},l().createElement(c.eX,{containerClassName:"slds-m-right_x-small",className:"slds-icon_x-small",assistiveText:!1,symbol:"offline"}),l().createElement(b.A,{level:"2"},"You are in offline mode. ",l().createElement(v.A,null,"More Information")))}],x=a.XB.code,w=a.XB.h2,A=a.XB.h3,O=a.XB.h4,N=a.XB.p,S=function(){return(0,r.createElement)(a.Ay,{},(0,r.createElement)("div",{className:"doc 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."),(0,r.createElement)(s.A,{exampleOnly:!0},(0,m.NO)(E)),w({id:"About-Alert"},"About Alert"),A({id:"Accessibility"},"Accessibility"),O({id:"Role"},"Role"),N({},"Alert notifications should contain ",x({},'role="alert"')," on the container to signal to assistive technology that they require the user’s immediate attention."),(0,r.createElement)(o.A,{toggleCode:!1},(0,r.createElement)("div",{className:"slds-notify slds-notify_alert",role:"alert"},"...")),O({id:"Assistive-Text"},"Assistive Text"),N({},"Use a span with the class ",x({},"slds-assistive-text")," to let the user know what type of notification it is."),(0,r.createElement)(o.A,{toggleCode:!1},(0,r.createElement)("span",{className:"slds-assistive-text"},"Info")),w({id:"Base"},"Base"),N({},"Use the info alert when notifying the user of neutral information about the system."),(0,r.createElement)(s.A,null,(0,m.NO)(E)),w({id:"Variations"},"Variations"),A({id:"Warning"},"Warning"),N({},"Use the warning variant to warn the user about important system information that deserves caution."),(0,r.createElement)(s.A,null,(0,m.NO)(_,"warning")),A({id:"Error"},"Error"),N({},"Use the error variant when you need to alert the user about an error in the system that needs immediate attention."),(0,r.createElement)(s.A,null,(0,m.NO)(_,"error")),A({id:"Offline"},"Offline"),N({},"Use the offline alert to let the user know that they are not connected to the internet."),(0,r.createElement)(s.A,null,(0,m.NO)(_,"offline")),w({id:"Styling-Hooks-Overview"},"Styling Hooks Overview"),(0,r.createElement)(f.A,{name:"alert",type:"component"}))},T=function(){return(0,a.Qr)(S())}}},l={};function a(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={id:e,exports:{}};return r[e](n,n.exports,a),n.exports}a.m=r,a.amdO={},e=[],a.O=function(t,n,r,l){if(!n){var s=1/0;for(m=0;m<e.length;m++){n=e[m][0],r=e[m][1],l=e[m][2];for(var o=!0,i=0;i<n.length;i++)(!1&l||s>=l)&&Object.keys(a.O).every(function(e){return a.O[e](n[i])})?n.splice(i--,1):(o=!1,l<s&&(s=l));if(o){e.splice(m--,1);var c=r();void 0!==c&&(t=c)}}return t}l=l||0;for(var m=e.length;m>0&&e[m-1][2]>l;m--)e[m]=e[m-1];e[m]=[n,r,l]},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},a.t=function(e,r){if(1&r&&(e=this(e)),8&r)return e;if("object"==typeof e&&e){if(4&r&&e.__esModule)return e;if(16&r&&"function"==typeof e.then)return e}var l=Object.create(null);a.r(l);var s={};t=t||[null,n({}),n([]),n(n)];for(var o=2&r&&e;("object"==typeof o||"function"==typeof o)&&!~t.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach(function(t){s[t]=function(){return e[t]}});return s.default=function(){return e},a.d(l,s),l},a.d=function(e,t){for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.e=function(){return Promise.resolve()},a.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.j=1103,function(){var e={1103:0};a.O.j=function(t){return 0===e[t]};var t=function(t,n){var r,l,s=n[0],o=n[1],i=n[2],c=0;if(s.some(function(t){return 0!==e[t]})){for(r in o)a.o(o,r)&&(a.m[r]=o[r]);if(i)var m=i(a)}for(t&&t(n);c<s.length;c++)l=s[c],a.o(e,l)&&e[l]&&e[l][0](),e[l]=0;return a.O(m)},n=self.webpackJsonpSLDS___internal_chunked_docs=self.webpackJsonpSLDS___internal_chunked_docs||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}(),a.nc=void 0;var s=a.O(void 0,[3540],function(){return a(8996)});s=a.O(s),(SLDS=void 0===SLDS?{}:SLDS)["__internal/chunked/docs/./ui/components/alert/docs.mdx.js"]=s}();