@primer/components 0.0.0-202110321848 → 0.0.0-202110322387

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-202110321848
3
+ ## 0.0.0-202110322387
4
4
 
5
5
  ### Major Changes
6
6
 
7
- - [#1568](https://github.com/primer/react/pull/1568) [`8ef9e7cb`](https://github.com/primer/react/commit/8ef9e7cbbab729c281d68e7b84c1db69e42ee791) Thanks [@jfuchs](https://github.com/jfuchs)! - Pagehead 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
+ - [#1576](https://github.com/primer/react/pull/1576) [`b3d8f4b6`](https://github.com/primer/react/commit/b3d8f4b670336fe693de6a11d83e75e7d4df47fb) Thanks [@jfuchs](https://github.com/jfuchs)! - Timeline 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
 
@@ -1197,6 +1197,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1197
1197
  padding-bottom: ${Nt("space.4")};
1198
1198
  margin-bottom: ${Nt("space.4")};
1199
1199
  border-bottom: 1px solid ${Nt("colors.border.default")};
1200
+ ${It};
1200
1201
  ${rr};
1201
1202
  `;const Hi=f.a`
1202
1203
  display: inline-block;
@@ -1907,13 +1908,13 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1907
1908
  line-height: 0;
1908
1909
 
1909
1910
  ${e=>{switch(e.size){case"large":case"extralarge":return p(["margin-right:",";"],Nt("space.2"));default:return p(["margin-right:",";"],Nt("space.1"))}}}
1910
- `,Nd=i(((t,r)=>{const{as:o,onRemove:a,id:n,leadingVisual:i,text:l,size:d,hideRemoveButton:s,href:c,onClick:f,...g}=t,u=vd(t)&&Boolean(a)&&!s,p={as:o,href:c,onClick:f};return e.createElement(Cd,Pt({onRemove:a,hideRemoveButton:s||!a,id:null==n?void 0:n.toString(),text:l,size:d,isTokenInteractive:vd(t)},u?{}:p,g,{ref:r}),i?e.createElement(zd,{size:d},e.createElement(i,null)):null,e.createElement(Ed,u?p:{},l),!s&&a?e.createElement(Sd,{borderOffset:1,onClick:e=>{e.stopPropagation(),a&&a()},size:d,isParentInteractive:vd(t),"aria-hidden":u?"true":"false",sx:u?{position:"relative",zIndex:"1"}:{}}):null)}));Nd.displayName="Token",Nd.defaultProps={size:"medium"};var Id=Nd;const Ad={small:0,medium:1,large:1,extralarge:2};function Rd({icon:o,contrast:a,className:n,block:i,disabled:l,theme:d,sx:s,tokens:c,onTokenRemove:f,tokenComponent:g,preventTokenWrapping:u,size:p,hideTokenRemoveButtons:b,maxHeight:m,width:h,minWidth:v,maxWidth:x,variant:y,visibleTokenCount:w,...B},$){const{onBlur:k,onFocus:T,onKeyDown:S,...E}=function(e){var t={};for(var r in e)md.test(r)||(t[r]=e[r]);return t}(B),C=zr($),z=Do(r(null),C),[N,I]=t(),[A,R]=t(Boolean(w)),{containerRef:L}=Oo({focusOutBehavior:"wrap",bindKeys:Mr.ArrowHorizontal|Mr.HomeAndEnd,focusableElementFilter:e=>!e.getAttributeNames().includes("aria-hidden"),getNextFocusable:e=>{var t;if(!N&&0!==N)return;let r=N+1;return"next"===e&&(r+=1),"previous"===e&&(r-=1),r>c.length||r<1?z.current||void 0:null===(t=L.current)||void 0===t?void 0:t.children[r]}},[N]),O=e=>{f(e),setTimeout((()=>{var e,t;const r=null===(e=L.current)||void 0===e?void 0:e.children[N||0],o=r&&$r(r)?r:Array.from((null===(t=L.current)||void 0===t?void 0:t.children)||[]).find((e=>$r(e)));var a;o?o.focus():null===(a=C.current)||void 0===a||a.focus()}),0)},M=()=>{I(void 0),setTimeout((()=>{var e;null!==(e=L.current)&&void 0!==e&&e.contains(document.activeElement)||!w||R(!0)}),0)},P=e=>{var t;"Escape"===e.key&&(null===(t=C.current)||void 0===t||t.focus())},H=e=>{e.stopPropagation()},D=A?c.slice(0,w):c;return e.createElement(on,{block:i,className:n,contrast:a,disabled:l,hasIcon:!!o,theme:d,width:h,minWidth:v,maxWidth:x,variant:y,onClick:()=>{var e;null===(e=z.current)||void 0===e||e.focus()},sx:{...i?{display:"flex",width:"100%"}:{},...m?{maxHeight:m,overflow:"auto"}:{},...u?{overflow:"auto"}:{},...s}},e.createElement(or,{ref:L,display:"flex",sx:{alignItems:"center",flexWrap:u?"nowrap":"wrap",marginLeft:"-0.25rem",marginBottom:"-0.25rem",flexGrow:1,"> *":{flexShrink:0,marginLeft:"0.25rem",marginBottom:"0.25rem"}}},e.createElement(or,{sx:{order:1,flexGrow:1}},o&&e.createElement(o,{className:"TextInput-icon"}),e.createElement(tn,Pt({ref:z,disabled:l,onFocus:e=>{T&&T(e),I(void 0),w&&R(!1)},onBlur:e=>{k&&k(e),setTimeout((()=>{var e;null!==(e=L.current)&&void 0!==e&&e.contains(document.activeElement)||!w||R(!0)}),0)},onKeyDown:e=>{var t;if(S&&S(e),null!==(t=C.current)&&void 0!==t&&t.value)return;const r=c[c.length-1];"Backspace"===e.key&&r&&(O(r.id),C.current&&(C.current.value=`${r.text} `),setTimeout((()=>{var e;null===(e=C.current)||void 0===e||e.select()}),0))},type:"text",sx:{height:"100%"}},E))),g?D.map((({id:t,...r},o)=>{return e.createElement(g,Pt({key:t,onFocus:(a=o,()=>{I(a)}),onBlur:M,onKeyUp:P,onClick:H,isSelected:N===o,onRemove:()=>{O(t)},hideRemoveButton:b,size:p,tabIndex:0},r));var a})):null,A?e.createElement(qn,{color:"fg.muted",fontSize:p&&Ad[p]},"+",c.length-D.length):null))}Rd.displayName="TextInputWithTokensInnerComponent";const Ld=e.forwardRef(Rd);Ld.defaultProps={tokenComponent:Id,size:"extralarge",hideTokenRemoveButtons:!1,preventTokenWrapping:!1},Ld.displayName="TextInputWithTokens";var Od=Ld;const Md=f(or)`
1911
+ `,Nd=i(((t,r)=>{const{as:o,onRemove:a,id:n,leadingVisual:i,text:l,size:d,hideRemoveButton:s,href:c,onClick:f,...g}=t,u=vd(t)&&Boolean(a)&&!s,p={as:o,href:c,onClick:f};return e.createElement(Cd,Pt({onRemove:a,hideRemoveButton:s||!a,id:null==n?void 0:n.toString(),text:l,size:d,isTokenInteractive:vd(t)},u?{}:p,g,{ref:r}),i?e.createElement(zd,{size:d},e.createElement(i,null)):null,e.createElement(Ed,u?p:{},l),!s&&a?e.createElement(Sd,{borderOffset:1,onClick:e=>{e.stopPropagation(),a&&a()},size:d,isParentInteractive:vd(t),"aria-hidden":u?"true":"false",sx:u?{position:"relative",zIndex:"1"}:{}}):null)}));Nd.displayName="Token",Nd.defaultProps={size:"medium"};var Id=Nd;const Ad={small:0,medium:1,large:1,extralarge:2};function Rd({icon:o,contrast:a,className:n,block:i,disabled:l,theme:d,sx:s,tokens:c,onTokenRemove:f,tokenComponent:g,preventTokenWrapping:u,size:p,hideTokenRemoveButtons:b,maxHeight:m,width:h,minWidth:v,maxWidth:x,variant:y,visibleTokenCount:w,...B},$){const{onBlur:k,onFocus:T,onKeyDown:S,...E}=function(e){var t={};for(var r in e)md.test(r)||(t[r]=e[r]);return t}(B),C=zr($),z=Do(r(null),C),[N,I]=t(),[A,R]=t(Boolean(w)),{containerRef:L}=Oo({focusOutBehavior:"wrap",bindKeys:Mr.ArrowHorizontal|Mr.HomeAndEnd,focusableElementFilter:e=>!e.getAttributeNames().includes("aria-hidden"),getNextFocusable:e=>{var t;if(!N&&0!==N)return;let r=N+1;return"next"===e&&(r+=1),"previous"===e&&(r-=1),r>c.length||r<1?z.current||void 0:null===(t=L.current)||void 0===t?void 0:t.children[r]}},[N]),O=e=>{f(e),setTimeout((()=>{var e,t;const r=null===(e=L.current)||void 0===e?void 0:e.children[N||0],o=r&&$r(r)?r:Array.from((null===(t=L.current)||void 0===t?void 0:t.children)||[]).find((e=>$r(e)));var a;o?o.focus():null===(a=C.current)||void 0===a||a.focus()}),0)},M=()=>{I(void 0),setTimeout((()=>{var e;null!==(e=L.current)&&void 0!==e&&e.contains(document.activeElement)||!w||R(!0)}),0)},P=e=>{var t;"Escape"===e.key&&(null===(t=C.current)||void 0===t||t.focus())},H=e=>{e.stopPropagation()},D=A?c.slice(0,w):c;return e.createElement(on,{block:i,className:n,contrast:a,disabled:l,hasIcon:!!o,theme:d,width:h,minWidth:v,maxWidth:x,variant:y,onClick:()=>{var e;null===(e=z.current)||void 0===e||e.focus()},sx:{...i?{display:"flex",width:"100%"}:{},...m?{maxHeight:m,overflow:"auto"}:{},...u?{overflow:"auto"}:{},...s}},e.createElement(or,{ref:L,display:"flex",sx:{alignItems:"center",flexWrap:u?"nowrap":"wrap",marginLeft:"-0.25rem",marginBottom:"-0.25rem",flexGrow:1,"> *":{flexShrink:0,marginLeft:"0.25rem",marginBottom:"0.25rem"}}},e.createElement(or,{sx:{order:1,flexGrow:1}},o&&e.createElement(o,{className:"TextInput-icon"}),e.createElement(tn,Pt({ref:z,disabled:l,onFocus:e=>{T&&T(e),I(void 0),w&&R(!1)},onBlur:e=>{k&&k(e),setTimeout((()=>{var e;null!==(e=L.current)&&void 0!==e&&e.contains(document.activeElement)||!w||R(!0)}),0)},onKeyDown:e=>{var t;if(S&&S(e),null!==(t=C.current)&&void 0!==t&&t.value)return;const r=c[c.length-1];"Backspace"===e.key&&r&&(O(r.id),C.current&&(C.current.value=`${r.text} `),setTimeout((()=>{var e;null===(e=C.current)||void 0===e||e.select()}),0))},type:"text",sx:{height:"100%"}},E))),g?D.map((({id:t,...r},o)=>{return e.createElement(g,Pt({key:t,onFocus:(a=o,()=>{I(a)}),onBlur:M,onKeyUp:P,onClick:H,isSelected:N===o,onRemove:()=>{O(t)},hideRemoveButton:b,size:p,tabIndex:0},r));var a})):null,A?e.createElement(qn,{color:"fg.muted",fontSize:p&&Ad[p]},"+",c.length-D.length):null))}Rd.displayName="TextInputWithTokensInnerComponent";const Ld=e.forwardRef(Rd);Ld.defaultProps={tokenComponent:Id,size:"extralarge",hideTokenRemoveButtons:!1,preventTokenWrapping:!1},Ld.displayName="TextInputWithTokens";var Od=Ld;const Md=f.div`
1911
1912
  display: flex;
1912
1913
  flex-direction: column;
1913
1914
  ${e=>e.clipSidebar&&p([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"])}
1914
1915
 
1915
1916
  ${rr};
1916
- `,Pd=f(or).attrs((e=>({className:en("Timeline-Item",e.className)})))`
1917
+ `,Pd=f.div.attrs((e=>({className:en("Timeline-Item",e.className)})))`
1917
1918
  display: flex;
1918
1919
  position: relative;
1919
1920
  padding: ${Nt("space.3")} 0;
@@ -1932,9 +1933,8 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1932
1933
 
1933
1934
  ${e=>e.condensed&&p(["padding-top:",";padding-bottom:0;&:last-child{padding-bottom:",";}.TimelineItem-Badge{height:16px;margin-top:",";margin-bottom:",";color:",";background-color:",";border:0;}"],Nt("space.1"),Nt("space.3"),Nt("space.2"),Nt("space.2"),Nt("colors.fg.muted"),Nt("colors.canvas.default"))}
1934
1935
 
1935
- ${It};
1936
1936
  ${rr};
1937
- `,Hd=t=>e.createElement(or,{position:"relative",zIndex:1},e.createElement(or,Pt({display:"flex",className:en(t.className,"TimelineItem-Badge"),flexShrink:0,borderRadius:"50%",borderWidth:"2px",borderStyle:"solid",borderColor:"canvas.default",overflow:"hidden",color:"fg.muted",bg:"timeline.badgeBg",width:"32px",height:"32px",mr:2,ml:"-15px",alignItems:"center",justifyContent:"center"},t),t.children));Hd.displayName="TimelineBadge";const Dd=f(or)`
1937
+ `,Hd=t=>e.createElement(or,{position:"relative",zIndex:1},e.createElement(or,{display:"flex",className:"TimelineItem-Badge",flexShrink:0,borderRadius:"50%",borderWidth:"2px",borderStyle:"solid",borderColor:"canvas.default",overflow:"hidden",color:"fg.muted",bg:"timeline.badgeBg",width:"32px",height:"32px",mr:2,ml:"-15px",alignItems:"center",justifyContent:"center",sx:t.sx},t.children));Hd.displayName="TimelineBadge";const Dd=f.div`
1938
1938
  min-width: 0;
1939
1939
  max-width: 100%;
1940
1940
  margin-top: ${Nt("space.1")};
@@ -1942,7 +1942,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1942
1942
  flex: auto;
1943
1943
  font-size: ${Nt("fontSizes.1")};
1944
1944
  ${rr};
1945
- `,Wd=f(or)`
1945
+ `,Wd=f.div`
1946
1946
  position: relative
1947
1947
  z-index: 1;
1948
1948
  height: 24px;