@primer/components 0.0.0-20211016233521 → 0.0.0-2021101701833

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.
@@ -318,26 +318,24 @@
318
318
  }
319
319
  }
320
320
 
321
- ${yt};
322
- ${$t};
323
321
  ${Kt};
324
- `,Ka=({dialogLabelId:e,title:r,subtitle:a,dialogDescriptionId:o,onClose:i})=>{const l=t.useCallback((()=>{i("close-button")}),[i]);return n.default.createElement(no.Header,null,n.default.createElement(qt,{display:"flex"},n.default.createElement(qt,{display:"flex",px:2,py:"6px",flexDirection:"column",flexGrow:1},n.default.createElement(no.Title,{id:e},null!=r?r:"Dialog"),a&&n.default.createElement(no.Subtitle,{id:o},a)),n.default.createElement(no.CloseButton,{onClose:l})))};Ka.displayName="DefaultHeader";const qa=({children:e})=>n.default.createElement(no.Body,null,e);qa.displayName="DefaultBody";const Xa=({footerButtons:e})=>{const{containerRef:t}=Ia({bindKeys:Er.ArrowHorizontal|Er.Tab,focusInStrategy:"closest"});return e?n.default.createElement(no.Footer,{ref:t},n.default.createElement(no.Buttons,{buttons:e})):null},Ya=n.default.forwardRef(((e,r)=>{const{title:a="Dialog",subtitle:o="",renderHeader:i,renderBody:l,renderFooter:d,onClose:s,role:c="dialog",width:f="xlarge",height:u="auto",footerButtons:g=[]}=e,p=Wa(),b=Wa(),m=t.useRef(null);for(const e of g)e.autoFocus&&(e.ref=m);const h={...e,title:a,subtitle:o,role:c,dialogLabelId:p,dialogDescriptionId:b},v=t.useRef(null),x=Pa(v,r),y=t.useRef(null);Ea({containerRef:v,restoreFocusOnCleanUp:!0,initialFocusRef:m}),xr((e=>{s("escape"),e.preventDefault()}),[s]);const w=(null!=i?i:Ka)(h),B=(null!=l?l:qa)(h),k=(null!=d?d:Xa)(h);return n.default.createElement(n.default.Fragment,null,n.default.createElement(Ma,null,n.default.createElement(ja,{ref:y},n.default.createElement(Va,{width:f,height:u,ref:x,role:c,"aria-labelledby":p,"aria-describedby":b},w,B,k))))}));Ya.displayName="Dialog";const Ja=i.default(qt).attrs({as:"header"})`
322
+ `,Ka=({dialogLabelId:e,title:r,subtitle:a,dialogDescriptionId:o,onClose:i})=>{const l=t.useCallback((()=>{i("close-button")}),[i]);return n.default.createElement(no.Header,null,n.default.createElement(qt,{display:"flex"},n.default.createElement(qt,{display:"flex",px:2,py:"6px",flexDirection:"column",flexGrow:1},n.default.createElement(no.Title,{id:e},null!=r?r:"Dialog"),a&&n.default.createElement(no.Subtitle,{id:o},a)),n.default.createElement(no.CloseButton,{onClose:l})))};Ka.displayName="DefaultHeader";const qa=({children:e})=>n.default.createElement(no.Body,null,e);qa.displayName="DefaultBody";const Xa=({footerButtons:e})=>{const{containerRef:t}=Ia({bindKeys:Er.ArrowHorizontal|Er.Tab,focusInStrategy:"closest"});return e?n.default.createElement(no.Footer,{ref:t},n.default.createElement(no.Buttons,{buttons:e})):null},Ya=n.default.forwardRef(((e,r)=>{const{title:a="Dialog",subtitle:o="",renderHeader:i,renderBody:l,renderFooter:d,onClose:s,role:c="dialog",width:f="xlarge",height:u="auto",footerButtons:g=[]}=e,p=Wa(),b=Wa(),m=t.useRef(null);for(const e of g)e.autoFocus&&(e.ref=m);const h={...e,title:a,subtitle:o,role:c,dialogLabelId:p,dialogDescriptionId:b},v=t.useRef(null),x=Pa(v,r),y=t.useRef(null);Ea({containerRef:v,restoreFocusOnCleanUp:!0,initialFocusRef:m}),xr((e=>{s("escape"),e.preventDefault()}),[s]);const w=(null!=i?i:Ka)(h),B=(null!=l?l:qa)(h),k=(null!=d?d:Xa)(h);return n.default.createElement(n.default.Fragment,null,n.default.createElement(Ma,null,n.default.createElement(ja,{ref:y},n.default.createElement(Va,{width:f,height:u,ref:x,role:c,"aria-labelledby":p,"aria-describedby":b},w,B,k))))}));Ya.displayName="Dialog";const Ja=i.default.div.attrs({as:"header"})`
325
323
  box-shadow: 0 1px 0 ${xt("colors.border.default")};
326
324
  padding: ${xt("space.2")};
327
325
  z-index: 1;
328
326
  flex-shrink: 0;
329
- `,Za=i.default(qt)`
327
+ `,Za=i.default.div`
330
328
  font-size: ${xt("fontSizes.1")};
331
329
  font-weight: ${xt("fontWeights.bold")};
332
- `,Qa=i.default(qt)`
330
+ `,Qa=i.default.div`
333
331
  font-size: ${xt("fontSizes.0")};
334
332
  margin-top: ${xt("space.1")};
335
333
  color: ${xt("colors.fg.muted")};
336
- `,eo=i.default(qt)`
334
+ `,eo=i.default.div`
337
335
  flex-grow: 1;
338
336
  overflow: auto;
339
337
  padding: ${xt("space.3")};
340
- `,to=i.default(qt).attrs({as:"footer"})`
338
+ `,to=i.default.div.attrs({as:"footer"})`
341
339
  box-shadow: 0 -1px 0 ${xt("colors.border.default")};
342
340
  padding: ${xt("space.3")};
343
341
  display: flex;