@salesforce-ux/design-system
Version:
Salesforce Lightning Design System
1 lines • 9.96 kB
JavaScript
var SLDS=SLDS||{};SLDS["__internal/chunked/docs/ui/components/panels/docs.mdx.js"]=function(e){function t(t){for(var l,o,s=t[0],r=t[1],d=t[2],h=0,f=[];h<s.length;h++)o=s[h],i[o]&&f.push(i[o][0]),i[o]=0;for(l in r)Object.prototype.hasOwnProperty.call(r,l)&&(e[l]=r[l]);for(c&&c(t);f.length;)f.shift()();return n.push.apply(n,d||[]),a()}function a(){for(var e,t=0;t<n.length;t++){for(var a=n[t],l=!0,s=1;s<a.length;s++){var r=a[s];0!==i[r]&&(l=!1)}l&&(n.splice(t--,1),e=o(o.s=a[0]))}return e}var l={},i={24:0},n=[];function o(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,o),a.l=!0,a.exports}o.m=e,o.c=l,o.d=function(e,t,a){o.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:a})},o.r=function(e){Object.defineProperty(e,"__esModule",{value:!0})},o.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return o.d(t,"a",t),t},o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},o.p="/assets/scripts/bundle/";var s=this.webpackJsonpSLDS___internal_chunked_docs=this.webpackJsonpSLDS___internal_chunked_docs||[],r=s.push.bind(s);s.push=t,s=s.slice();for(var d=0;d<s.length;d++)t(s[d]);var c=r;return n.push([261,0]),a()}({0:function(e,t){e.exports=React},261:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getContents=t.getElement=void 0;var l=a(0),i=(u(l),a(7)),n=u(i),o=u(a(9)),s=u(a(11)),r=u(a(10)),d=u(a(12)),c=a(67),h=u(c),f=a(44);u(a(4));function u(e){return e&&e.__esModule?e:{default:e}}var p=i.factories.a,m=i.factories.code,g=i.factories.h2,y=i.factories.h3,b=i.factories.h4,v=i.factories.li,_=i.factories.ol,k=i.factories.p,E=i.factories.strong,w=i.factories.table,P=i.factories.tbody,x=i.factories.td,T=i.factories.th,C=i.factories.thead,S=i.factories.tr,z=t.getElement=function(){return(0,l.createElement)(n.default,{},(0,l.createElement)("div",{className:"lead doc"},"A panel is typically used to provide supplemental information or form inputs that relate to your primary canvas."),g({id:"Base-Panel"},"Base Panel"),k({},"A panel is docked to the left/right side of a viewport and is in the document flow of the canvas or main content."),k({},E({},"Use this component when:")),_({},v({},"The canvas content extends beyond the boundaries of the viewport, while panning and zooming is supported"),v({},"It is not important to see canvas content while completing the task in a Panel"),v({},"The task performed in a Panel is momentary")),k({},"Toggling visibility of a Panel will re-flow the main content."),k({},"The panel should take up 100% of the height of its parent container. In most cases, that would be the viewport or main stage of your application."),(0,l.createElement)(r.default,{title:"Panel base"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"600px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"left",invoke:"toggle"},"A panel body accepts any layout or component"))),g({id:"Header"},"Header"),k({},"The header is docked to the top of its panel. When the content of the panel body becomes overflowed, the body will provide scrolling while the header remains visible in place."),k({},"The header of a left/right docked panel has left-aligned text by default and one icon that dismisses the panel. The header title should truncate when it becomes too long for the panel width by using the ",m({},"slds-truncate")," class on the title."),(0,l.createElement)(r.default,{title:"Panel base - header"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"50px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"left",invoke:"toggle"}))),y({id:"Centered-Text"},"Centered Text"),k({},"To center the header title, add the class ",m({},"slds-panel__header_align-center")," to the ",m({},"<div>")," with class ",m({},"slds-panel__header"),"."),(0,l.createElement)(r.default,{title:"Panel base - header"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"50px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"left",invoke:"toggle",hasCenterTitle:!0}))),y({id:"Custom-Header"},"Custom Header"),k({},"If a panel header requires additional elements outside of a title and close button, The panel header needs to have the class ",m({},"slds-panel__header_custom")," added to ",m({},"slds-panel__header"),". This notifies the component that it has a custom layout in the header."),(0,l.createElement)(s.default,{toggleCode:!1},(0,l.createElement)("div",{className:"slds-panel__header slds-panel__header_custom"},"...")),k({},"The ",m({},"<h2>")," which contains the title of the panel requires the class ",m({},"slds-panel__header-title"),"."),g({id:"Invoked-via-Toggle"},"Invoked via Toggle"),(0,l.createElement)(d.default,{type:"a11y",header:"Accessibility Requirement"},"When toggling the visibility, author must manage user focus by placing the user inside the panel when it opens and returning them to the trigger when it closes."),y({id:"Positioning"},"Positioning"),k({},"The ",m({},"slds-panel_docked")," element can be positioned on the left or right side of a viewport by adding the class ",m({},"slds-panel_docked-left")," or ",m({},"slds-panel_docked-right"),"."),b({id:"Left-side"},"Left side"),(0,l.createElement)(r.default,{title:"Panel base - left dock toggle"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"200px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"left",invoke:"toggle"},"A panel body accepts any layout or component"))),b({id:"Right-side"},"Right side"),(0,l.createElement)(r.default,{title:"Panel base - right dock toggle"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"200px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"right",invoke:"toggle"},"A panel body accepts any layout or component"))),g({id:"Drilled-In-State"},"Drilled-In State"),(0,l.createElement)(d.default,{type:"note",header:"Design Note"},"If the panel has been drilled into, then the panel displays an arrow facing to the left to indicate the direction the user drilled in from."),(0,l.createElement)(d.default,{type:"a11y",header:"Accessibility Requirement"},"When the user drills in, the author must manage user focus by keeping the user inside the panel when it drills in and returning them to the drill-in trigger when it the user presses the back arrow."),y({id:"Positioning-2"},"Positioning"),b({id:"Left-side-2"},"Left side"),(0,l.createElement)(r.default,{title:"Panel base - Left dock drill in"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"200px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"left",invoke:"drill-in"},"A panel body accepts any layout or component"))),b({id:"Right-side-2"},"Right side"),(0,l.createElement)(r.default,{title:"Panel base - Right dock drill in"},(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"200px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Panel Header",docked:"right",invoke:"drill-in"},"A panel body accepts any layout or component"))),g({id:"Sizing"},"Sizing"),k({},"The panel width can be modified by applying a sizing class to the ",m({},"slds-panel")," element."),k({},"The panels come in 5 different sizes:"),w({},C({},S({},T({},"Width"),T({},"SLDS Class"))),P({},S({},x({},"240px"),x({},m({},"slds-size_small"))),S({},x({},"320px"),x({},m({},"slds-size_medium"))),S({},x({},"400px"),x({},m({},"slds-size_large"))),S({},x({},"640px"),x({},m({},"slds-size_x-large"))),S({},x({},"100%"),x({},m({},"slds-size_full"))))),g({id:"Panel-Visibility"},"Panel Visibility"),y({id:"Open-as-a-drawer"},"Open as a drawer"),k({},"A panel causes reflow by being in the flow of the layout rather than overlayed on top of the content. To achieve this, simply toggle the class ",m({},"slds-is-open")," to the ",m({},"slds-panel_docked")," element."),(0,l.createElement)(r.default,{title:"Panel base - Drawer"},(0,l.createElement)(c.PanelPlayground,{drawer:!0})),g({id:"Panels-for-Filtering"},"Panels for Filtering"),k({},"Filtering lists or reports can be done by using a Filtering expressions inside of a Panel. Check out the ",p({href:"/components/expression/#filtering"},"Filtering expression")," component for different states and accessibility requirements."),k({},(0,l.createElement)(d.default,{type:"a11y",header:"Accessibility Requirement"},"Make sure to use assistive text to improve the clarity of what you might be editing, for example, add ",(0,l.createElement)("code",{className:"doc"},'<span className="slds-assistive-text">Edit filter:</span>')," to the button element inside each filterable object.")),(0,l.createElement)(o.default,{style:{backgroundColor:"#fafaf9",position:"relative",height:"600px",overflow:"hidden"}},(0,l.createElement)(h.default,{size:"medium",title:"Filter",docked:"right",invoke:"toggle"},(0,l.createElement)(f.Filters,null,(0,l.createElement)("ol",{className:"slds-list_vertical slds-list_vertical-space"},(0,l.createElement)(f.FilterObject,{type:"Show Me"},"All Products")),(0,l.createElement)("h3",{className:"slds-text-body_small slds-m-vertical_x-small"},"Matching all these filters"),(0,l.createElement)("ol",{className:"slds-list_vertical slds-list_vertical-space"},(0,l.createElement)(f.FilterObject,{type:"Created Date",removable:!0},"equals THIS WEEK"),(0,l.createElement)(f.FilterObject,{type:"List Price",removable:!0},'greater than "500"')),(0,l.createElement)(f.FiltersFooter,null)))))};t.getContents=function(){return(0,i.createTableOfContents)(z())}},6:function(e,t){e.exports=JSBeautify}});