@primer/components 0.0.0-2021829205643 → 0.0.0-202182923742

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.
@@ -438,7 +438,6 @@
438
438
  color: ${({variant:e,item:r})=>Bo(e,null==r?void 0:r.disabled).color};
439
439
  // 2 frames on a 60hz monitor
440
440
  transition: background 33.333ms linear;
441
- text-decoration: none;
442
441
 
443
442
  @media (hover: hover) and (pointer: fine) {
444
443
  :hover {
@@ -542,7 +541,7 @@
542
541
  flex-basis: var(--description-container-flex-basis);
543
542
  `,Ao=d.default.input`
544
543
  pointer-events: none;
545
- `,No=n.default.forwardRef(((e,t)=>{const{as:a,text:o,description:d,descriptionVariant:i="inline",selected:l,selectionVariant:c,leadingVisual:f,trailingIcon:s,trailingText:g,variant:b="default",showDivider:u,disabled:p,onAction:h,onKeyPress:m,children:x,onClick:v,id:B,...y}=e,w=Ma(),k=Ma(),$=r.useCallback((r=>{if(p)return;null==m||m(r);r.target instanceof HTMLInputElement&&"checkbox"===r.target.type&&" "===r.key||!r.defaultPrevented&&[" ","Enter"].includes(r.key)&&(null==h||h(e,r))}),[h,p,e,m]),T=r.useCallback((r=>{p||(null==v||v(r),r.defaultPrevented||null==h||h(e,r))}),[h,p,e,v]),S=vo[b],I=Gr(S.hover,"inherit"),E=Gr(S.focus,"inherit"),{theme:C}=Ur();return n.default.createElement(ko,Sr({ref:t,as:a,tabIndex:p?void 0:-1,variant:b,showDivider:u,"aria-selected":l,"aria-labelledby":o?w:void 0,"aria-describedby":d?k:void 0},y,{"data-id":B,onKeyPress:$,onClick:T,hoverBackground:p?"inherit":I,focusBackground:p?"inherit":E}),!!l===l&&n.default.createElement(To,null,"multiple"===c?n.default.createElement(n.default.Fragment,null,n.default.createElement(Ao,{disabled:p,tabIndex:-1,type:"checkbox",checked:l,"aria-label":o,readOnly:!0,"aria-readonly":"false"})):l&&n.default.createElement(Qt,{fill:null==C?void 0:C.colors.text.primary})),f&&n.default.createElement(Io,{variant:b,disabled:p},n.default.createElement(f,null)),n.default.createElement(yo,null,n.default.createElement(wo,{style:{"--main-content-flex-direction":"inline"===i?"row":"column"}},x,o?n.default.createElement($o,{id:w},o):null,d?n.default.createElement(Co,{id:k,style:{"--description-container-margin-left":"inline"===i?vr("space.2")(C):0,"--description-container-flex-basis":"inline"===i?0:"auto"}},"block"===i?d:n.default.createElement(ho,{title:d,inline:!0,maxWidth:"100%"},d)):null),s||g?n.default.createElement(Eo,{variant:b,disabled:p},g,s&&n.default.createElement(s,null)):null))}));No.displayName="Item";const Ro=d.default.div`
544
+ `;function No(e){const{text:t,description:a,descriptionVariant:o="inline",selected:d,selectionVariant:i,leadingVisual:l,trailingIcon:c,trailingText:f,variant:s="default",showDivider:g,disabled:b,onAction:u,onKeyPress:p,children:h,onClick:m,id:x,...v}=e,B=Ma(),y=Ma(),w=r.useCallback((r=>{if(b)return;null==p||p(r);r.target instanceof HTMLInputElement&&"checkbox"===r.target.type&&" "===r.key||!r.defaultPrevented&&[" ","Enter"].includes(r.key)&&(null==u||u(e,r))}),[u,b,e,p]),k=r.useCallback((r=>{b||(null==m||m(r),r.defaultPrevented||null==u||u(e,r))}),[u,b,e,m]),$=vo[s],T=Gr($.hover,"inherit"),S=Gr($.focus,"inherit"),{theme:I}=Ur();return n.default.createElement(ko,Sr({tabIndex:b?void 0:-1,variant:s,showDivider:g,"aria-selected":d,"aria-labelledby":t?B:void 0,"aria-describedby":a?y:void 0},v,{"data-id":x,onKeyPress:w,onClick:k,hoverBackground:b?"inherit":T,focusBackground:b?"inherit":S}),!!d===d&&n.default.createElement(To,null,"multiple"===i?n.default.createElement(n.default.Fragment,null,n.default.createElement(Ao,{disabled:b,tabIndex:-1,type:"checkbox",checked:d,"aria-label":t,readOnly:!0,"aria-readonly":"false"})):d&&n.default.createElement(Qt,{fill:null==I?void 0:I.colors.text.primary})),l&&n.default.createElement(Io,{variant:s,disabled:b},n.default.createElement(l,null)),n.default.createElement(yo,null,n.default.createElement(wo,{style:{"--main-content-flex-direction":"inline"===o?"row":"column"}},h,t?n.default.createElement($o,{id:B},t):null,a?n.default.createElement(Co,{id:y,style:{"--description-container-margin-left":"inline"===o?vr("space.2")(I):0,"--description-container-flex-basis":"inline"===o?0:"auto"}},"block"===o?a:n.default.createElement(ho,{title:a,inline:!0,maxWidth:"100%"},a)):null),c||f?n.default.createElement(Eo,{variant:s,disabled:b},f,c&&n.default.createElement(c,null)):null))}No.displayName="Item";const Ro=d.default.div`
546
545
  font-size: ${vr("fontSizes.1")};
547
546
  /* 14px font-size * 1.428571429 = 20px line height
548
547
  *
@@ -555,7 +554,7 @@
555
554
  --item-hover-bg-override: none;
556
555
  --item-hover-divider-border-color-override: ${vr("colors.border.muted")};
557
556
  }
558
- `;const Ho=n.default.forwardRef(((e,r)=>{const{firstGroupStyle:t,lastGroupStyle:a,headerStyle:o,itemStyle:d}=function(e="inset"){switch(e){case"full":return{headerStyle:{paddingX:vr("space.2")},itemStyle:{borderRadius:0}};default:return{firstGroupStyle:{marginTop:vr("space.2")},lastGroupStyle:{marginBottom:vr("space.2")},itemStyle:{marginX:vr("space.2")}}}}(e.variant),i=(r,t,a)=>{var o,i,l;const c="renderItem"in r&&r.renderItem||e.renderItem||No,f=null!==(o=null!==(i="key"in r?r.key:void 0)&&void 0!==i?i:null===(l=r.id)||void 0===l?void 0:l.toString())&&void 0!==o?o:a.toString();return n.default.createElement(c,Sr({showDivider:e.showItemDividers,selectionVariant:e.selectionVariant},r,{key:f,sx:{...d,...r.sx},item:t}))};let l=[];if(function(e){return"groupMetadata"in e}(e)){const r=e.groupMetadata.reduce(((e,r)=>e.set(r.groupId,r)),new Map);for(const t of e.items){var c,f,s;const e=r.get(t.groupId),a=null!==(c=null==e||null===(f=e.items)||void 0===f?void 0:f.length)&&void 0!==c?c:0;r.set(t.groupId,{...e,items:[...null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[],i({showDivider:null==e?void 0:e.showItemDividers,...e&&"renderItem"in e&&{renderItem:e.renderItem},...t},t,a)]})}l=[...r.values()]}else l=[{items:e.items.map(((e,r)=>i(e,e,r))),groupId:"0"}];return n.default.createElement(Ro,Sr({},e,{ref:r}),l.map((({header:r,...d},i)=>{const c="filled"===(null==r?void 0:r.variant),f=i>0&&!c;return n.default.createElement(n.default.Fragment,{key:d.groupId},f?n.default.createElement(xo,{key:`${d.groupId}-divider`}):null,(r=>{var t;const a=(null!==(t="renderGroup"in r&&r.renderGroup)&&void 0!==t?t:e.renderGroup)||uo;return n.default.createElement(a,Sr({},r,{key:r.groupId}))})({sx:{...0===i&&t,...i===l.length-1&&a,...i>0&&!f&&{mt:2}},...r&&{header:{...r,sx:{...o,...r.sx}}},...d}))})))}));Ho.displayName="ActionList";const Lo=Object.assign(Ho,{Group:uo,Item:No,Divider:xo}),zo={xsmall:"192px",small:"256px",medium:"320px",large:"432px",xlarge:"600px",auto:"auto",initial:"auto"},Oo={small:"256px",medium:"320px",large:"480px",xlarge:"640px",xxlarge:"960px",auto:"auto"};const Mo=d.default.div`
557
+ `;const Ho=n.default.forwardRef(((e,r)=>{const{firstGroupStyle:t,lastGroupStyle:a,headerStyle:o,itemStyle:d}=function(e="inset"){switch(e){case"full":return{headerStyle:{paddingX:vr("space.2")},itemStyle:{borderRadius:0}};default:return{firstGroupStyle:{marginTop:vr("space.2")},lastGroupStyle:{marginBottom:vr("space.2")},itemStyle:{marginX:vr("space.2")}}}}(e.variant),i=(r,t,a)=>{var o,i,l;const c="renderItem"in r&&r.renderItem||e.renderItem||No,f=null!==(o=null!==(i=r.key)&&void 0!==i?i:null===(l=r.id)||void 0===l?void 0:l.toString())&&void 0!==o?o:a.toString();return n.default.createElement(c,Sr({showDivider:e.showItemDividers,selectionVariant:e.selectionVariant},r,{key:f,sx:{...d,...r.sx},item:t}))};let l=[];if(function(e){return"groupMetadata"in e}(e)){const r=e.groupMetadata.reduce(((e,r)=>e.set(r.groupId,r)),new Map);for(const t of e.items){var c,f,s;const e=r.get(t.groupId),a=null!==(c=null==e||null===(f=e.items)||void 0===f?void 0:f.length)&&void 0!==c?c:0;r.set(t.groupId,{...e,items:[...null!==(s=null==e?void 0:e.items)&&void 0!==s?s:[],i({showDivider:null==e?void 0:e.showItemDividers,...e&&"renderItem"in e&&{renderItem:e.renderItem},...t},t,a)]})}l=[...r.values()]}else l=[{items:e.items.map(((e,r)=>i(e,e,r))),groupId:"0"}];return n.default.createElement(Ro,Sr({},e,{ref:r}),l.map((({header:r,...d},i)=>{const c="filled"===(null==r?void 0:r.variant),f=i>0&&!c;return n.default.createElement(n.default.Fragment,{key:d.groupId},f?n.default.createElement(xo,{key:`${d.groupId}-divider`}):null,(r=>{var t;const a=(null!==(t="renderGroup"in r&&r.renderGroup)&&void 0!==t?t:e.renderGroup)||uo;return n.default.createElement(a,Sr({},r,{key:r.groupId}))})({sx:{...0===i&&t,...i===l.length-1&&a,...i>0&&!f&&{mt:2}},...r&&{header:{...r,sx:{...o,...r.sx}}},...d}))})))}));Ho.displayName="ActionList";const Lo=Object.assign(Ho,{Group:uo,Item:No,Divider:xo}),zo={xsmall:"192px",small:"256px",medium:"320px",large:"432px",xlarge:"600px",auto:"auto",initial:"auto"},Oo={small:"256px",medium:"320px",large:"480px",xlarge:"640px",xxlarge:"960px",auto:"auto"};const Mo=d.default.div`
559
558
  background-color: ${vr("colors.canvas.overlay")};
560
559
  box-shadow: ${vr("shadows.overlay.shadow")};
561
560
  position: absolute;