@primer/components 0.0.0-202110322387 → 0.0.0-2021103224249

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-202110322387
3
+ ## 0.0.0-2021103224249
4
4
 
5
5
  ### Major Changes
6
6
 
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.
7
+ - [#1577](https://github.com/primer/react/pull/1577) [`b28cd7f1`](https://github.com/primer/react/commit/b28cd7f17fd0a3f876a1c36bae20927df51f71d2) Thanks [@jfuchs](https://github.com/jfuchs)! - Tooltip 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
 
@@ -1908,13 +1908,13 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1908
1908
  line-height: 0;
1909
1909
 
1910
1910
  ${e=>{switch(e.size){case"large":case"extralarge":return p(["margin-right:",";"],Nt("space.2"));default:return p(["margin-right:",";"],Nt("space.1"))}}}
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
+ `,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)`
1912
1912
  display: flex;
1913
1913
  flex-direction: column;
1914
1914
  ${e=>e.clipSidebar&&p([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"])}
1915
1915
 
1916
1916
  ${rr};
1917
- `,Pd=f.div.attrs((e=>({className:en("Timeline-Item",e.className)})))`
1917
+ `,Pd=f(or).attrs((e=>({className:en("Timeline-Item",e.className)})))`
1918
1918
  display: flex;
1919
1919
  position: relative;
1920
1920
  padding: ${Nt("space.3")} 0;
@@ -1933,8 +1933,9 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1933
1933
 
1934
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"))}
1935
1935
 
1936
+ ${It};
1936
1937
  ${rr};
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
+ `,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)`
1938
1939
  min-width: 0;
1939
1940
  max-width: 100%;
1940
1941
  margin-top: ${Nt("space.1")};
@@ -1942,7 +1943,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
1942
1943
  flex: auto;
1943
1944
  font-size: ${Nt("fontSizes.1")};
1944
1945
  ${rr};
1945
- `,Wd=f.div`
1946
+ `,Wd=f(or)`
1946
1947
  position: relative
1947
1948
  z-index: 1;
1948
1949
  height: 24px;
@@ -2185,7 +2186,7 @@ import e,{useState as t,useRef as r,useCallback as o,useEffect as a,useMemo as n
2185
2186
  &.tooltipped-align-left-2::before {
2186
2187
  left: 10px;
2187
2188
  }
2188
- ${It};
2189
+
2189
2190
  ${rr};
2190
2191
  `;function ss({direction:t="n",children:r,className:o,text:a,noDelay:n,align:i,wrap:l,...d}){const s=en(o,`tooltipped-${t}`,i&&`tooltipped-align-${i}-2`,n&&"tooltipped-no-delay",l&&"tooltipped-multiline");return e.createElement(ds,Pt({role:"tooltip","aria-label":a},d,{className:s}),r)}ss.displayName="Tooltip",ss.alignments=["left","right"],ss.directions=["n","ne","e","se","s","sw","w","nw"];const cs=f.nav`
2191
2192
  display: flex;