@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 +2 -2
- package/dist/browser.esm.js +5 -5
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +5 -5
- package/dist/browser.umd.js.map +1 -1
- package/lib/Pagehead.d.ts +2 -1
- package/lib/Pagehead.js +1 -1
- package/lib/Timeline.d.ts +19 -393
- package/lib/Timeline.js +16 -13
- package/lib-esm/Pagehead.d.ts +2 -1
- package/lib-esm/Pagehead.js +2 -2
- package/lib-esm/Timeline.d.ts +19 -393
- package/lib-esm/Timeline.js +12 -13
- package/package.json +1 -1
package/dist/browser.umd.js
CHANGED
@@ -1197,6 +1197,7 @@
|
|
1197
1197
|
padding-bottom: ${xt("space.4")};
|
1198
1198
|
margin-bottom: ${xt("space.4")};
|
1199
1199
|
border-bottom: 1px solid ${xt("colors.border.default")};
|
1200
|
+
${yt};
|
1200
1201
|
${Kt};
|
1201
1202
|
`;const Ii=i.default.a`
|
1202
1203
|
display: inline-block;
|
@@ -1907,13 +1908,13 @@
|
|
1907
1908
|
line-height: 0;
|
1908
1909
|
|
1909
1910
|
${e=>{switch(e.size){case"large":case"extralarge":return r.css(["margin-right:",";"],xt("space.2"));default:return r.css(["margin-right:",";"],xt("space.1"))}}}
|
1910
|
-
`,Td=t.forwardRef(((e,t)=>{const{as:r,onRemove:a,id:o,leadingVisual:i,text:l,size:d,hideRemoveButton:s,href:c,onClick:f,...u}=e,g=pd(e)&&Boolean(a)&&!s,p={as:r,href:c,onClick:f};return n.default.createElement($d,Tt({onRemove:a,hideRemoveButton:s||!a,id:null==o?void 0:o.toString(),text:l,size:d,isTokenInteractive:pd(e)},g?{}:p,u,{ref:t}),i?n.default.createElement(Sd,{size:d},n.default.createElement(i,null)):null,n.default.createElement(kd,g?p:{},l),!s&&a?n.default.createElement(Bd,{borderOffset:1,onClick:e=>{e.stopPropagation(),a&&a()},size:d,isParentInteractive:pd(e),"aria-hidden":g?"true":"false",sx:g?{position:"relative",zIndex:"1"}:{}}):null)}));Td.displayName="Token",Td.defaultProps={size:gd};var Ed=Td;const Cd={small:0,medium:1,large:1,extralarge:2};function zd({icon:e,contrast:r,className:a,block:o,disabled:i,theme:l,sx:d,tokens:s,onTokenRemove:c,tokenComponent:f,preventTokenWrapping:u,size:g,hideTokenRemoveButtons:p,maxHeight:b,width:m,minWidth:h,maxWidth:v,variant:x,visibleTokenCount:y,...w},B){const{onBlur:k,onFocus:$,onKeyDown:S,...T}=function(e){var t={};for(var r in e)fd.test(r)||(t[r]=e[r]);return t}(w),E=yr(B),C=Oa(t.useRef(null),E),[z,R]=t.useState(),[N,A]=t.useState(Boolean(y)),{containerRef:I}=za({focusOutBehavior:"wrap",bindKeys:Er.ArrowHorizontal|Er.HomeAndEnd,focusableElementFilter:e=>!e.getAttributeNames().includes("aria-hidden"),getNextFocusable:e=>{var t;if(!z&&0!==z)return;let r=z+1;return"next"===e&&(r+=1),"previous"===e&&(r-=1),r>s.length||r<1?C.current||void 0:null===(t=I.current)||void 0===t?void 0:t.children[r]}},[z]),L=e=>{c(e),setTimeout((()=>{var e,t;const r=null===(e=I.current)||void 0===e?void 0:e.children[z||0],a=r&&pr(r)?r:Array.from((null===(t=I.current)||void 0===t?void 0:t.children)||[]).find((e=>pr(e)));var o;a?a.focus():null===(o=E.current)||void 0===o||o.focus()}),0)},O=()=>{R(void 0),setTimeout((()=>{var e;null!==(e=I.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},M=e=>{var t;"Escape"===e.key&&(null===(t=E.current)||void 0===t||t.focus())},P=e=>{e.stopPropagation()},H=N?s.slice(0,y):s;return n.default.createElement(Zo,{block:o,className:a,contrast:r,disabled:i,hasIcon:!!e,theme:l,width:m,minWidth:h,maxWidth:v,variant:x,onClick:()=>{var e;null===(e=C.current)||void 0===e||e.focus()},sx:{...o?{display:"flex",width:"100%"}:{},...b?{maxHeight:b,overflow:"auto"}:{},...u?{overflow:"auto"}:{},...d}},n.default.createElement(qt,{ref:I,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"}}},n.default.createElement(qt,{sx:{order:1,flexGrow:1}},e&&n.default.createElement(e,{className:"TextInput-icon"}),n.default.createElement(Yo,Tt({ref:C,disabled:i,onFocus:e=>{$&&$(e),R(void 0),y&&A(!1)},onBlur:e=>{k&&k(e),setTimeout((()=>{var e;null!==(e=I.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},onKeyDown:e=>{var t;if(S&&S(e),null!==(t=E.current)&&void 0!==t&&t.value)return;const r=s[s.length-1];"Backspace"===e.key&&r&&(L(r.id),E.current&&(E.current.value=`${r.text} `),setTimeout((()=>{var e;null===(e=E.current)||void 0===e||e.select()}),0))},type:"text",sx:{height:"100%"}},T))),f?H.map((({id:e,...t},r)=>{return n.default.createElement(f,Tt({key:e,onFocus:(a=r,()=>{R(a)}),onBlur:O,onKeyUp:M,onClick:P,isSelected:z===r,onRemove:()=>{L(e)},hideRemoveButton:p,size:g,tabIndex:0},t));var a})):null,N?n.default.createElement(jn,{color:"fg.muted",fontSize:g&&Cd[g]},"+",s.length-H.length):null))}zd.displayName="TextInputWithTokensInnerComponent";const Rd=n.default.forwardRef(zd);Rd.defaultProps={tokenComponent:Ed,size:"extralarge",hideTokenRemoveButtons:!1,preventTokenWrapping:!1},Rd.displayName="TextInputWithTokens";var Nd=Rd;const Ad=i.default
|
1911
|
+
`,Td=t.forwardRef(((e,t)=>{const{as:r,onRemove:a,id:o,leadingVisual:i,text:l,size:d,hideRemoveButton:s,href:c,onClick:f,...u}=e,g=pd(e)&&Boolean(a)&&!s,p={as:r,href:c,onClick:f};return n.default.createElement($d,Tt({onRemove:a,hideRemoveButton:s||!a,id:null==o?void 0:o.toString(),text:l,size:d,isTokenInteractive:pd(e)},g?{}:p,u,{ref:t}),i?n.default.createElement(Sd,{size:d},n.default.createElement(i,null)):null,n.default.createElement(kd,g?p:{},l),!s&&a?n.default.createElement(Bd,{borderOffset:1,onClick:e=>{e.stopPropagation(),a&&a()},size:d,isParentInteractive:pd(e),"aria-hidden":g?"true":"false",sx:g?{position:"relative",zIndex:"1"}:{}}):null)}));Td.displayName="Token",Td.defaultProps={size:gd};var Ed=Td;const Cd={small:0,medium:1,large:1,extralarge:2};function zd({icon:e,contrast:r,className:a,block:o,disabled:i,theme:l,sx:d,tokens:s,onTokenRemove:c,tokenComponent:f,preventTokenWrapping:u,size:g,hideTokenRemoveButtons:p,maxHeight:b,width:m,minWidth:h,maxWidth:v,variant:x,visibleTokenCount:y,...w},B){const{onBlur:k,onFocus:$,onKeyDown:S,...T}=function(e){var t={};for(var r in e)fd.test(r)||(t[r]=e[r]);return t}(w),E=yr(B),C=Oa(t.useRef(null),E),[z,R]=t.useState(),[N,A]=t.useState(Boolean(y)),{containerRef:I}=za({focusOutBehavior:"wrap",bindKeys:Er.ArrowHorizontal|Er.HomeAndEnd,focusableElementFilter:e=>!e.getAttributeNames().includes("aria-hidden"),getNextFocusable:e=>{var t;if(!z&&0!==z)return;let r=z+1;return"next"===e&&(r+=1),"previous"===e&&(r-=1),r>s.length||r<1?C.current||void 0:null===(t=I.current)||void 0===t?void 0:t.children[r]}},[z]),L=e=>{c(e),setTimeout((()=>{var e,t;const r=null===(e=I.current)||void 0===e?void 0:e.children[z||0],a=r&&pr(r)?r:Array.from((null===(t=I.current)||void 0===t?void 0:t.children)||[]).find((e=>pr(e)));var o;a?a.focus():null===(o=E.current)||void 0===o||o.focus()}),0)},O=()=>{R(void 0),setTimeout((()=>{var e;null!==(e=I.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},M=e=>{var t;"Escape"===e.key&&(null===(t=E.current)||void 0===t||t.focus())},P=e=>{e.stopPropagation()},H=N?s.slice(0,y):s;return n.default.createElement(Zo,{block:o,className:a,contrast:r,disabled:i,hasIcon:!!e,theme:l,width:m,minWidth:h,maxWidth:v,variant:x,onClick:()=>{var e;null===(e=C.current)||void 0===e||e.focus()},sx:{...o?{display:"flex",width:"100%"}:{},...b?{maxHeight:b,overflow:"auto"}:{},...u?{overflow:"auto"}:{},...d}},n.default.createElement(qt,{ref:I,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"}}},n.default.createElement(qt,{sx:{order:1,flexGrow:1}},e&&n.default.createElement(e,{className:"TextInput-icon"}),n.default.createElement(Yo,Tt({ref:C,disabled:i,onFocus:e=>{$&&$(e),R(void 0),y&&A(!1)},onBlur:e=>{k&&k(e),setTimeout((()=>{var e;null!==(e=I.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},onKeyDown:e=>{var t;if(S&&S(e),null!==(t=E.current)&&void 0!==t&&t.value)return;const r=s[s.length-1];"Backspace"===e.key&&r&&(L(r.id),E.current&&(E.current.value=`${r.text} `),setTimeout((()=>{var e;null===(e=E.current)||void 0===e||e.select()}),0))},type:"text",sx:{height:"100%"}},T))),f?H.map((({id:e,...t},r)=>{return n.default.createElement(f,Tt({key:e,onFocus:(a=r,()=>{R(a)}),onBlur:O,onKeyUp:M,onClick:P,isSelected:z===r,onRemove:()=>{L(e)},hideRemoveButton:p,size:g,tabIndex:0},t));var a})):null,N?n.default.createElement(jn,{color:"fg.muted",fontSize:g&&Cd[g]},"+",s.length-H.length):null))}zd.displayName="TextInputWithTokensInnerComponent";const Rd=n.default.forwardRef(zd);Rd.defaultProps={tokenComponent:Ed,size:"extralarge",hideTokenRemoveButtons:!1,preventTokenWrapping:!1},Rd.displayName="TextInputWithTokens";var Nd=Rd;const Ad=i.default.div`
|
1911
1912
|
display: flex;
|
1912
1913
|
flex-direction: column;
|
1913
1914
|
${e=>e.clipSidebar&&r.css([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"])}
|
1914
1915
|
|
1915
1916
|
${Kt};
|
1916
|
-
`,Id=i.default
|
1917
|
+
`,Id=i.default.div.attrs((e=>({className:Xo("Timeline-Item",e.className)})))`
|
1917
1918
|
display: flex;
|
1918
1919
|
position: relative;
|
1919
1920
|
padding: ${xt("space.3")} 0;
|
@@ -1932,9 +1933,8 @@
|
|
1932
1933
|
|
1933
1934
|
${e=>e.condensed&&r.css(["padding-top:",";padding-bottom:0;&:last-child{padding-bottom:",";}.TimelineItem-Badge{height:16px;margin-top:",";margin-bottom:",";color:",";background-color:",";border:0;}"],xt("space.1"),xt("space.3"),xt("space.2"),xt("space.2"),xt("colors.fg.muted"),xt("colors.canvas.default"))}
|
1934
1935
|
|
1935
|
-
${yt};
|
1936
1936
|
${Kt};
|
1937
|
-
`,Ld=e=>n.default.createElement(qt,{position:"relative",zIndex:1},n.default.createElement(qt,
|
1937
|
+
`,Ld=e=>n.default.createElement(qt,{position:"relative",zIndex:1},n.default.createElement(qt,{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:e.sx},e.children));Ld.displayName="TimelineBadge";const Od=i.default.div`
|
1938
1938
|
min-width: 0;
|
1939
1939
|
max-width: 100%;
|
1940
1940
|
margin-top: ${xt("space.1")};
|
@@ -1942,7 +1942,7 @@
|
|
1942
1942
|
flex: auto;
|
1943
1943
|
font-size: ${xt("fontSizes.1")};
|
1944
1944
|
${Kt};
|
1945
|
-
`,Md=i.default
|
1945
|
+
`,Md=i.default.div`
|
1946
1946
|
position: relative
|
1947
1947
|
z-index: 1;
|
1948
1948
|
height: 24px;
|