@primer/components 0.0.0-2021103205051 → 0.0.0-2021103211630

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.
package/CHANGELOG.md CHANGED
@@ -1,10 +1,10 @@
1
1
  # @primer/components
2
2
 
3
- ## 0.0.0-2021103205051
3
+ ## 0.0.0-2021103211630
4
4
 
5
5
  ### Major Changes
6
6
 
7
- - [#1564](https://github.com/primer/react/pull/1564) [`bdd6c479`](https://github.com/primer/react/commit/bdd6c479613960e20e9298f009f053414728eb7a) Thanks [@jfuchs](https://github.com/jfuchs)! - Label no longer accepts styled-system props. Please use the `sx` prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information about `sx` and https://primer.style/react/system-props for context on the removal.
7
+ - [#1569](https://github.com/primer/react/pull/1569) [`dc113234`](https://github.com/primer/react/commit/dc113234038b94ba635f0055b19b1cac4d29e17b) Thanks [@jfuchs](https://github.com/jfuchs)! - Pagination no longer accepts styled-system props. Please use the `sx` prop to extend Primer component styling instead. See also https://primer.style/react/overriding-styles for information about `sx` and https://primer.style/react/system-props for context on the removal.
8
8
 
9
9
  ### Minor Changes
10
10
 
@@ -1155,22 +1155,22 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1155
1155
  margin-right: 0;
1156
1156
  }
1157
1157
  ${rr};
1158
- `;const Ii=p(["margin-top:-1px;margin-bottom:-1px;color:",";border:"," solid ",";box-shadow:none;",";background-color:transparent;"],Nt("colors.fg.muted"),Nt("borderWidths.1"),Nt("colors.border.default"),ct),Ai=ue({variants:{small:{fontSize:0,lineHeight:"16px",padding:"0px 8px"},medium:{fontSize:0,lineHeight:"20px",padding:"0 8px"},large:{fontSize:0,lineHeight:"24px",padding:"0 12px"},xl:{fontSize:1,lineHeight:"16px",padding:"8px 12px"}}}),Ri=f.span`
1158
+ `;const Ii=p(["margin-top:-1px;margin-bottom:-1px;color:",";border:"," solid ",";box-shadow:none;",";",";background-color:transparent;"],Nt("colors.fg.muted"),Nt("borderWidths.1"),Nt("colors.border.default"),ct,It),Ai=ue({variants:{small:{fontSize:0,lineHeight:"16px",padding:"0px 8px"},medium:{fontSize:0,lineHeight:"20px",padding:"0 8px"},large:{fontSize:0,lineHeight:"24px",padding:"0 12px"},xl:{fontSize:1,lineHeight:"16px",padding:"8px 12px"}}}),Ri=f.span`
1159
1159
  display: inline-block;
1160
1160
  font-weight: ${Nt("fontWeights.semibold")};
1161
1161
  color: ${Nt("colors.fg.onEmphasis")};
1162
1162
  border-radius: ${Nt("radii.3")};
1163
- bg: ${Nt("colors.neutral.emphasis")}
1164
1163
 
1165
1164
  &:hover {
1166
1165
  text-decoration: none;
1167
1166
  }
1168
1167
 
1169
1168
  ${Ai}
1169
+ ${It}
1170
1170
  ${e=>e.dropshadow?"box-shadow: inset 0 -1px 0 rgba(27, 31, 35, 0.12)":""}
1171
1171
  ${e=>e.outline?Ii:""} // must be last to override other values
1172
1172
  ${rr}
1173
- `;Ri.defaultProps={variant:"medium"};var Li=Ri;const Oi=L({hoverColor:{property:"color",scale:"colors"}});var Mi=f.a`
1173
+ `;Ri.defaultProps={bg:"neutral.emphasis",variant:"medium"};var Li=Ri;const Oi=L({hoverColor:{property:"color",scale:"colors"}});var Mi=f.a`
1174
1174
  color: ${e=>e.muted?Nt("colors.fg.muted")(e):Nt("colors.accent.fg")(e)};
1175
1175
  text-decoration: ${e=>e.underline?"underline":"none"};
1176
1176
  &:hover {
@@ -1297,8 +1297,6 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1297
1297
  );
1298
1298
  }
1299
1299
  }
1300
-
1301
- ${It};
1302
1300
  `;function Di({theme:t,pageCount:r,currentPage:o,onPageChange:a,hrefBuilder:n,marginPageCount:i,showPages:l,surroundingPageCount:d}){const s=e.useCallback((e=>t=>a(t,e)),[a]),c=e.useMemo((()=>function(e,t,r,o,a){const n=[];if(r){const r=[],i=t=>{t>=1&&t<=e&&r.push(t)};let l=t-a,d=t+a;if(l<1&&d>e)l=1,d=e;else if(l<1)for(;l<1;)l++,d++;else if(d>e)for(;d>e;)l--,d--;for(let t=1;t<=o;t++){const r=t,o=e-(t-1);r>=l?d++:i(r),o<=d?l--:i(o)}for(let e=l;e<=d;e++)i(e);const s=r.slice().sort(((e,t)=>e-t)).filter(((e,t,r)=>!t||e!==r[t-1]));for(let e=0;e<s.length;e++){const r=s[e],o=r===t;0===e?(1!==r&&n.push({type:"BREAK",num:1}),n.push({type:"NUM",num:r,selected:o})):(1==r-s[e-1]||n.push({type:"BREAK",num:r-1}),n.push({type:"NUM",num:r,selected:o}))}const c=n[n.length-1];"NUM"===c.type&&c.num!==e&&n.push({type:"BREAK",num:e})}const i={type:"NEXT",num:t+1,disabled:t===e};return[{type:"PREV",num:t-1,disabled:1===t},...n,i]}(r,o,!!l,i,d)),[r,o,l,i,d]);return e.useMemo((()=>c.map((r=>{const{props:o,key:a,content:i}=function(e,t,r){const o={};let a="",n="";switch(e.type){case"PREV":n="page-prev",a="Previous",e.disabled?Object.assign(o,{as:"span","aria-disabled":"true"}):Object.assign(o,{rel:"prev",href:t(e.num),"aria-label":"Previous Page",onClick:r});break;case"NEXT":n="page-next",a="Next",e.disabled?Object.assign(o,{as:"span","aria-disabled":"true"}):Object.assign(o,{rel:"next",href:t(e.num),"aria-label":"Next Page",onClick:r});break;case"NUM":n=`page-${e.num}`,a=String(e.num),e.selected?Object.assign(o,{as:"em","aria-current":"page"}):Object.assign(o,{href:t(e.num),"aria-label":`Page ${e.num}`,onClick:r});break;case"BREAK":n=`page-${e.num}-break`,a="…",Object.assign(o,{as:"span","aria-disabled":!0})}return{props:o,key:n,content:a}}(r,n,s(r.num));return e.createElement(Hi,Pt({},o,{key:a,theme:t}),i)}))),[c,n,s,t])}const Wi=f.nav`
1303
1301
  margin-top: 20px;
1304
1302
  margin-bottom: 15px;