@primer/components 0.0.0-2021111191656 → 0.0.0-2021111212257
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 +1 -1
- package/dist/browser.esm.js +60 -60
- package/dist/browser.esm.js.map +1 -1
- package/dist/browser.umd.js +62 -62
- package/dist/browser.umd.js.map +1 -1
- package/lib/ActionList2/{MenuContext.d.ts → ActionListContainerContext.d.ts} +3 -3
- package/lib/ActionList2/{MenuContext.js → ActionListContainerContext.js} +3 -3
- package/lib/ActionList2/Item.js +4 -6
- package/lib/ActionList2/List.js +2 -2
- package/lib/ActionList2/Selection.js +4 -4
- package/lib/ActionMenu2.d.ts +13 -9
- package/lib/ActionMenu2.js +63 -29
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/index.js +9 -1
- package/lib-esm/ActionList2/{MenuContext.d.ts → ActionListContainerContext.d.ts} +3 -3
- package/lib-esm/ActionList2/{MenuContext.js → ActionListContainerContext.js} +1 -1
- package/lib-esm/ActionList2/Item.js +4 -6
- package/lib-esm/ActionList2/List.js +2 -2
- package/lib-esm/ActionList2/Selection.js +4 -4
- package/lib-esm/ActionMenu2.d.ts +13 -9
- package/lib-esm/ActionMenu2.js +60 -27
- package/lib-esm/hooks/index.d.ts +1 -0
- package/lib-esm/hooks/index.js +2 -1
- package/package.json +3 -4
package/dist/browser.umd.js
CHANGED
@@ -260,9 +260,9 @@
|
|
260
260
|
color: ${xt("colors.accent.fg")};
|
261
261
|
}
|
262
262
|
${jt};
|
263
|
-
`;var na=t.forwardRef(((e,t)=>n.default.createElement(oa,Bt({ref:t,"aria-label":"Close"},e),n.default.createElement(aa,null))));const ia={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]};function la(e,t,r={}){const a=function(e){let t=e.parentNode;for(;null!==t;){if(t instanceof HTMLElement&&"static"!==getComputedStyle(t).position)return t;t=t.parentNode}return document.body}(e),o=function(e){let t=e;for(;null!==t&&t!==document.body;){if("visible"!==getComputedStyle(t).overflow)break;t=t.parentNode}const r=t!==document.body&&t instanceof HTMLElement?t:document.body,a=r.getBoundingClientRect(),o=getComputedStyle(r),[n,i,l,d]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((e=>parseInt(e,10)||0));return{top:a.top+n,left:a.left+i,width:a.width-l-i,height:Math.max(a.height-n-d,r===document.body?window.innerHeight:-1/0)}}(a),n=getComputedStyle(a),i=a.getBoundingClientRect(),[l,d]=[n.borderTopWidth,n.borderLeftWidth].map((e=>parseInt(e,10)||0));return function(e,t,r,a,{side:o,align:n,allowOutOfBounds:i,anchorOffset:l,alignmentOffset:d}){const s={top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height};let c=ga(r,a,o,n,l,d),f=o;if(c.top-=t.top,c.left-=t.left,!i){const i=ia[o];let u=0;if(i){let e=o;for(;u<i.length&&pa(e,c,s,r);){const o=i[u++];e=o,c=ga(r,a,o,n,l,d),c.top-=t.top,c.left-=t.left,f=o}}c.top<s.top&&(c.top=s.top),c.left<s.left&&(c.left=s.left),c.left+r.width>e.width+s.left&&(c.left=e.width+s.left-r.width),i&&u<i.length&&c.top+r.height>e.height+s.top&&(c.top=e.height+s.top-r.height)}return{...c,anchorSide:f}}(o,{top:i.top+l,left:i.left+d},e.getBoundingClientRect(),t instanceof Element?t.getBoundingClientRect():t,function(e={}){var t,r,a,o,n;const i=null!==(t=e.side)&&void 0!==t?t:da,l=null!==(r=e.align)&&void 0!==r?r:sa;return{side:i,align:l,anchorOffset:null!==(a=e.anchorOffset)&&void 0!==a?a:"inside-center"===i?0:ca,alignmentOffset:null!==(o=e.alignmentOffset)&&void 0!==o?o:"center"!==l&&i.startsWith("inside")?fa:0,allowOutOfBounds:null!==(n=e.allowOutOfBounds)&&void 0!==n?n:ua}}(r))}const da="outside-bottom",sa="start",ca=4,fa=4,ua=!1;function ga(e,t,r,a,o,n){const i=t.left+t.width,l=t.top+t.height;let d=-1,s=-1;return"outside-top"===r?d=t.top-o-e.height:"outside-bottom"===r?d=l+o:"outside-left"===r?s=t.left-o-e.width:"outside-right"===r&&(s=i+o),"outside-top"!==r&&"outside-bottom"!==r||(s="start"===a?t.left+n:"center"===a?t.left-(e.width-t.width)/2+n:i-e.width-n),"outside-left"!==r&&"outside-right"!==r||(d="start"===a?t.top+n:"center"===a?t.top-(e.height-t.height)/2+n:l-e.height-n),"inside-top"===r?d=t.top+o:"inside-bottom"===r?d=l-o-e.height:"inside-left"===r?s=t.left+o:"inside-right"===r?s=i-o-e.width:"inside-center"===r&&(s=(i+t.left)/2-e.width/2+o),"inside-top"===r||"inside-bottom"===r?s="start"===a?t.left+n:"center"===a?t.left-(e.width-t.width)/2+n:i-e.width-n:"inside-left"!==r&&"inside-right"!==r&&"inside-center"!==r||(d="start"===a?t.top+n:"center"===a?t.top-(e.height-t.height)/2+n:l-e.height-n),{top:d,left:s}}function pa(e,t,r,a){return"outside-top"===e||"outside-bottom"===e?t.top<r.top||t.top+a.height>r.height+r.top:t.left<r.left||t.left+a.width>r.width+r.left}var ba="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function ha(e,t=[]){const r=br(null==e?void 0:e.floatingElementRef),a=br(null==e?void 0:e.anchorElementRef),[o,i]=n.default.useState(void 0),l=n.default.useCallback((()=>{r.current instanceof Element&&a.current instanceof Element?i(la(r.current,a.current,e)):i(void 0)}),[r,a,...t]);var d;return ba(l,[l]),ba((()=>{const e=new window.ResizeObserver((()=>d()));return e.observe(document.documentElement),()=>{e.disconnect()}}),[d=l]),{floatingElementRef:r,anchorElementRef:a,position:o}}yr();const
|
263
|
+
`;var na=t.forwardRef(((e,t)=>n.default.createElement(oa,Bt({ref:t,"aria-label":"Close"},e),n.default.createElement(aa,null))));const ia={"outside-top":["outside-bottom","outside-right","outside-left","outside-bottom"],"outside-bottom":["outside-top","outside-right","outside-left","outside-bottom"],"outside-left":["outside-right","outside-bottom","outside-top","outside-bottom"],"outside-right":["outside-left","outside-bottom","outside-top","outside-bottom"]};function la(e,t,r={}){const a=function(e){let t=e.parentNode;for(;null!==t;){if(t instanceof HTMLElement&&"static"!==getComputedStyle(t).position)return t;t=t.parentNode}return document.body}(e),o=function(e){let t=e;for(;null!==t&&t!==document.body;){if("visible"!==getComputedStyle(t).overflow)break;t=t.parentNode}const r=t!==document.body&&t instanceof HTMLElement?t:document.body,a=r.getBoundingClientRect(),o=getComputedStyle(r),[n,i,l,d]=[o.borderTopWidth,o.borderLeftWidth,o.borderRightWidth,o.borderBottomWidth].map((e=>parseInt(e,10)||0));return{top:a.top+n,left:a.left+i,width:a.width-l-i,height:Math.max(a.height-n-d,r===document.body?window.innerHeight:-1/0)}}(a),n=getComputedStyle(a),i=a.getBoundingClientRect(),[l,d]=[n.borderTopWidth,n.borderLeftWidth].map((e=>parseInt(e,10)||0));return function(e,t,r,a,{side:o,align:n,allowOutOfBounds:i,anchorOffset:l,alignmentOffset:d}){const s={top:e.top-t.top,left:e.left-t.left,width:e.width,height:e.height};let c=ga(r,a,o,n,l,d),f=o;if(c.top-=t.top,c.left-=t.left,!i){const i=ia[o];let u=0;if(i){let e=o;for(;u<i.length&&pa(e,c,s,r);){const o=i[u++];e=o,c=ga(r,a,o,n,l,d),c.top-=t.top,c.left-=t.left,f=o}}c.top<s.top&&(c.top=s.top),c.left<s.left&&(c.left=s.left),c.left+r.width>e.width+s.left&&(c.left=e.width+s.left-r.width),i&&u<i.length&&c.top+r.height>e.height+s.top&&(c.top=e.height+s.top-r.height)}return{...c,anchorSide:f}}(o,{top:i.top+l,left:i.left+d},e.getBoundingClientRect(),t instanceof Element?t.getBoundingClientRect():t,function(e={}){var t,r,a,o,n;const i=null!==(t=e.side)&&void 0!==t?t:da,l=null!==(r=e.align)&&void 0!==r?r:sa;return{side:i,align:l,anchorOffset:null!==(a=e.anchorOffset)&&void 0!==a?a:"inside-center"===i?0:ca,alignmentOffset:null!==(o=e.alignmentOffset)&&void 0!==o?o:"center"!==l&&i.startsWith("inside")?fa:0,allowOutOfBounds:null!==(n=e.allowOutOfBounds)&&void 0!==n?n:ua}}(r))}const da="outside-bottom",sa="start",ca=4,fa=4,ua=!1;function ga(e,t,r,a,o,n){const i=t.left+t.width,l=t.top+t.height;let d=-1,s=-1;return"outside-top"===r?d=t.top-o-e.height:"outside-bottom"===r?d=l+o:"outside-left"===r?s=t.left-o-e.width:"outside-right"===r&&(s=i+o),"outside-top"!==r&&"outside-bottom"!==r||(s="start"===a?t.left+n:"center"===a?t.left-(e.width-t.width)/2+n:i-e.width-n),"outside-left"!==r&&"outside-right"!==r||(d="start"===a?t.top+n:"center"===a?t.top-(e.height-t.height)/2+n:l-e.height-n),"inside-top"===r?d=t.top+o:"inside-bottom"===r?d=l-o-e.height:"inside-left"===r?s=t.left+o:"inside-right"===r?s=i-o-e.width:"inside-center"===r&&(s=(i+t.left)/2-e.width/2+o),"inside-top"===r||"inside-bottom"===r?s="start"===a?t.left+n:"center"===a?t.left-(e.width-t.width)/2+n:i-e.width-n:"inside-left"!==r&&"inside-right"!==r&&"inside-center"!==r||(d="start"===a?t.top+n:"center"===a?t.top-(e.height-t.height)/2+n:l-e.height-n),{top:d,left:s}}function pa(e,t,r,a){return"outside-top"===e||"outside-bottom"===e?t.top<r.top||t.top+a.height>r.height+r.top:t.left<r.left||t.left+a.width>r.width+r.left}var ba="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t.useLayoutEffect:t.useEffect;function ha(e,t=[]){const r=br(null==e?void 0:e.floatingElementRef),a=br(null==e?void 0:e.anchorElementRef),[o,i]=n.default.useState(void 0),l=n.default.useCallback((()=>{r.current instanceof Element&&a.current instanceof Element?i(la(r.current,a.current,e)):i(void 0)}),[r,a,...t]);var d;return ba(l,[l]),ba((()=>{const e=new window.ResizeObserver((()=>d()));return e.observe(document.documentElement),()=>{e.disconnect()}}),[d=l]),{floatingElementRef:r,anchorElementRef:a,position:o}}function ma(e,r,a){const[o,n]=t.useState(a);return[null!=e?e:o,t.useCallback((e=>{n(e),r&&r(e)}),[r])]}yr();const va=[];let xa;function ya(e,t=!1){return dr(e,{reverse:t,strict:!0,onlyTabbable:!0}).next().value}function wa(e,t,r){const a=new AbortController,o=null!=r?r:a.signal;let n;function i(r){if(r instanceof HTMLElement&&document.contains(e)){if(e.contains(r))return void(n=r);if(n&&cr(n)&&e.contains(n))return void n.focus();if(t&&e.contains(t))return void t.focus();{const t=null===e.getAttribute("tabindex");return t&&e.setAttribute("tabindex","-1"),e.focus(),void(t&&e.addEventListener("blur",(()=>e.removeAttribute("tabindex")),{once:!0}))}}}e.setAttribute("data-focus-trap","active");const l=function(e){const t=new AbortController;return e.addEventListener("abort",(()=>{t.abort()})),t}(o);if(e.addEventListener("keydown",(t=>{if("Tab"!==t.key||t.defaultPrevented)return;const{target:r}=t,a=ya(e),o=ya(e,!0);r===a&&t.shiftKey?(t.preventDefault(),null==o||o.focus()):r!==o||t.shiftKey||(t.preventDefault(),null==a||a.focus())}),{signal:l.signal}),xa){const e=xa;xa.container.setAttribute("data-focus-trap","suspended"),xa.controller.abort(),va.push(e)}l.signal.addEventListener("abort",(()=>{xa=void 0})),o.addEventListener("abort",(()=>{e.removeAttribute("data-focus-trap");const t=va.findIndex((t=>t.container===e));t>=0&&va.splice(t,1),function(){const e=va.pop();e&&wa(e.container,e.initialFocus,e.originalSignal)}()})),document.addEventListener("focus",(e=>{i(e.target)}),{signal:l.signal,capture:!0}),i(document.activeElement),xa={container:e,controller:l,initialFocus:t,originalSignal:o};const d=va.findIndex((t=>t.container===e));if(d>=0&&va.splice(d,1),!r)return a}function Ba(e,t=[]){const r=br(null==e?void 0:e.containerRef),a=br(null==e?void 0:e.initialFocusRef),o=null==e?void 0:e.disabled,i=n.default.useRef(),l=n.default.useRef(null);function d(){var t;null===(t=i.current)||void 0===t||t.abort(),null!=e&&e.restoreFocusOnCleanUp&&l.current instanceof HTMLElement&&(l.current.focus(),l.current=null)}return l.current||null!=e&&e.disabled||(l.current=document.activeElement),n.default.useEffect((()=>{if(r.current instanceof HTMLElement){var e;if(!o)return i.current=wa(r.current,null!==(e=a.current)&&void 0!==e?e:void 0),()=>{d()};d()}}),[r,a,o,...t]),{containerRef:r,initialFocusRef:a}}function ka({icon:e,...t}){return n.default.createElement(e,t)}ka.displayName="Octicon";const $a=i.default(ka)`
|
264
264
|
${jt}
|
265
|
-
|
265
|
+
`;$a.defaultProps={size:16};var Ta=$a;function Sa(e={},r=[]){const a=br(e.containerRef),o=!!e.activeDescendantFocus,i=br("boolean"!=typeof e.activeDescendantFocus&&e.activeDescendantFocus?e.activeDescendantFocus:void 0),l=e.disabled,d=n.default.useRef();return t.useEffect((()=>{if(a.current instanceof HTMLElement&&(!o||i.current instanceof HTMLElement)){if(!l){var t;const r={...e,activeDescendantControl:null!==(t=i.current)&&void 0!==t?t:void 0};return d.current=Ar(a.current,r),()=>{var e;null===(e=d.current)||void 0===e||e.abort()}}var r;null===(r=d.current)||void 0===r||r.abort()}}),[l,...r]),{containerRef:a,activeDescendantControlRef:i}}const Ca="__primerPortalRoot__",Ea="__default__",za={};function Ra(){const e=za.__default__;if(!e||!document.body.contains(e)){let e=document.getElementById(Ca);if(!(e instanceof Element)){e=document.createElement("div"),e.setAttribute("id",Ca),e.style.position="absolute",e.style.top="0",e.style.left="0";const t=document.querySelector("[data-portal-root]");t?t.appendChild(e):document.body.appendChild(e)}!function(e,t="__default__"){za[t]=e}(e)}}var Ia=({children:e,onMount:t,containerName:r})=>{const o=document.createElement("div");o.style.position="relative",o.style.zIndex="1";const i=n.default.useRef(o);return ba((()=>{let e=r;void 0===e&&(e=Ea,Ra());const a=za[e];if(!a)throw new Error(`Portal container '${r}' is not yet registered. Container must be registered with registerPortal before use.`);const o=i.current;return a.appendChild(o),null==t||t(),()=>{a.removeChild(o)}}),[i]),a.createPortal(e,i.current)};function Aa(...e){const r=t.useRef(null);return ba((()=>{function t(t=null){for(const r of e){if(!r)return;"function"==typeof r?r(t):r.current=t}}return t(r.current),()=>{t(r.current)}}),[...e,r.current]),r}const Na={prefix:String(Math.round(1e10*Math.random())),current:0},La=n.default.createContext(Na);let Fa=Boolean("undefined"!=typeof window&&window.document&&window.document.createElement);function Da(e){let r=t.useContext(La);return r!==Na||Fa||console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server."),t.useMemo((()=>e||"react-aria"+r.prefix+"-"+ ++r.current),[e])}const Ma="200ms",Oa=i.default("div")`
|
266
266
|
position: fixed;
|
267
267
|
top: 0;
|
268
268
|
left: 0;
|
@@ -272,7 +272,7 @@
|
|
272
272
|
align-items: center;
|
273
273
|
justify-content: center;
|
274
274
|
background-color: rgba(0, 0, 0, 0.4);
|
275
|
-
animation: dialog-backdrop-appear ${
|
275
|
+
animation: dialog-backdrop-appear ${Ma} ${xt("animation.easeOutCubic")};
|
276
276
|
|
277
277
|
@keyframes dialog-backdrop-appear {
|
278
278
|
0% {
|
@@ -282,7 +282,7 @@
|
|
282
282
|
opacity: 1;
|
283
283
|
}
|
284
284
|
}
|
285
|
-
`,
|
285
|
+
`,Pa={small:"480px",large:"640px",auto:"auto"},Ha={small:"296px",medium:"320px",large:"480px",xlarge:"640px"},Wa=i.default.div`
|
286
286
|
display: flex;
|
287
287
|
flex-direction: column;
|
288
288
|
background-color: ${xt("colors.canvas.overlay")};
|
@@ -290,11 +290,11 @@
|
|
290
290
|
min-width: 296px;
|
291
291
|
max-width: calc(100vw - 64px);
|
292
292
|
max-height: calc(100vh - 64px);
|
293
|
-
width: ${e=>{var t;return
|
294
|
-
height: ${e=>{var t;return
|
293
|
+
width: ${e=>{var t;return Ha[null!==(t=e.width)&&void 0!==t?t:"xlarge"]}};
|
294
|
+
height: ${e=>{var t;return Pa[null!==(t=e.height)&&void 0!==t?t:"auto"]}};
|
295
295
|
border-radius: 12px;
|
296
296
|
opacity: 1;
|
297
|
-
animation: overlay--dialog-appear ${
|
297
|
+
animation: overlay--dialog-appear ${Ma} ${xt("animation.easeOutCubic")};
|
298
298
|
|
299
299
|
@keyframes overlay--dialog-appear {
|
300
300
|
0% {
|
@@ -308,29 +308,29 @@
|
|
308
308
|
}
|
309
309
|
|
310
310
|
${jt};
|
311
|
-
`,
|
311
|
+
`,ja=({dialogLabelId:e,title:r,subtitle:a,dialogDescriptionId:o,onClose:i})=>{const l=t.useCallback((()=>{i("close-button")}),[i]);return n.default.createElement(eo.Header,null,n.default.createElement(_t,{display:"flex"},n.default.createElement(_t,{display:"flex",px:2,py:"6px",flexDirection:"column",flexGrow:1},n.default.createElement(eo.Title,{id:e},null!=r?r:"Dialog"),a&&n.default.createElement(eo.Subtitle,{id:o},a)),n.default.createElement(eo.CloseButton,{onClose:l})))};ja.displayName="DefaultHeader";const _a=({children:e})=>n.default.createElement(eo.Body,null,e);_a.displayName="DefaultBody";const Ua=({footerButtons:e})=>{const{containerRef:t}=Sa({bindKeys:Br.ArrowHorizontal|Br.Tab,focusInStrategy:"closest"});return e?n.default.createElement(eo.Footer,{ref:t},n.default.createElement(eo.Buttons,{buttons:e})):null},Va=n.default.forwardRef(((e,r)=>{const{title:a="Dialog",subtitle:o="",renderHeader:i,renderBody:l,renderFooter:d,onClose:s,role:c="dialog",width:f="xlarge",height:u="auto",footerButtons:g=[]}=e,p=Da(),b=Da(),h=t.useRef(null);for(const e of g)e.autoFocus&&(e.ref=h);const m={...e,title:a,subtitle:o,role:c,dialogLabelId:p,dialogDescriptionId:b},v=t.useRef(null),x=Aa(v,r),y=t.useRef(null);Ba({containerRef:v,restoreFocusOnCleanUp:!0,initialFocusRef:h}),pr((e=>{s("escape"),e.preventDefault()}),[s]);const w=(null!=i?i:ja)(m),B=(null!=l?l:_a)(m),k=(null!=d?d:Ua)(m);return n.default.createElement(n.default.Fragment,null,n.default.createElement(Ia,null,n.default.createElement(Oa,{ref:y},n.default.createElement(Wa,{width:f,height:u,ref:x,role:c,"aria-labelledby":p,"aria-describedby":b},w,B,k))))}));Va.displayName="Dialog";const Ka=i.default.div.attrs({as:"header"})`
|
312
312
|
box-shadow: 0 1px 0 ${xt("colors.border.default")};
|
313
313
|
padding: ${xt("space.2")};
|
314
314
|
z-index: 1;
|
315
315
|
flex-shrink: 0;
|
316
|
-
`,
|
316
|
+
`,Ga=i.default.div`
|
317
317
|
font-size: ${xt("fontSizes.1")};
|
318
318
|
font-weight: ${xt("fontWeights.bold")};
|
319
319
|
|
320
320
|
${jt};
|
321
|
-
`,
|
321
|
+
`,qa=i.default.div`
|
322
322
|
font-size: ${xt("fontSizes.0")};
|
323
323
|
margin-top: ${xt("space.1")};
|
324
324
|
color: ${xt("colors.fg.muted")};
|
325
325
|
|
326
326
|
${jt};
|
327
|
-
`,
|
327
|
+
`,Xa=i.default.div`
|
328
328
|
flex-grow: 1;
|
329
329
|
overflow: auto;
|
330
330
|
padding: ${xt("space.3")};
|
331
331
|
|
332
332
|
${jt};
|
333
|
-
`,
|
333
|
+
`,Ya=i.default.div.attrs({as:"footer"})`
|
334
334
|
box-shadow: 0 -1px 0 ${xt("colors.border.default")};
|
335
335
|
padding: ${xt("space.3")};
|
336
336
|
display: flex;
|
@@ -347,7 +347,7 @@
|
|
347
347
|
}
|
348
348
|
|
349
349
|
${jt};
|
350
|
-
`,
|
350
|
+
`,Ja={normal:Mr,primary:jr,danger:Or},Za=i.default(Mr)`
|
351
351
|
border-radius: 4px;
|
352
352
|
background: transparent;
|
353
353
|
border: 0;
|
@@ -357,21 +357,21 @@
|
|
357
357
|
align-self: flex-start;
|
358
358
|
line-height: normal;
|
359
359
|
box-shadow: none;
|
360
|
-
`,
|
360
|
+
`,Qa=({onClose:e})=>n.default.createElement(Za,{"aria-label":"Close",onClick:e},n.default.createElement(Ta,{icon:aa}));Qa.displayName="CloseButton";const eo=Object.assign(Va,{Header:Ka,Title:Ga,Subtitle:qa,Body:Xa,Footer:Ya,Buttons:({buttons:e})=>{var r;const a=br(null===(r=e.find((e=>e.autoFocus)))||void 0===r?void 0:r.ref);let o=0;const[i,l]=t.useState(0);return t.useEffect((()=>{var e;1===i?null===(e=a.current)||void 0===e||e.focus():l(i+1)}),[a,i]),n.default.createElement(n.default.Fragment,null,e.map(((e,t)=>{const{content:r,buttonType:i="normal",autoFocus:l=!1,...d}=e,s=Ja[i];return n.default.createElement(s,Bt({key:t},d,{variant:i,ref:l&&0===o?(o++,a):null}),r)})))},CloseButton:Qa}),to=i.default.header`
|
361
361
|
padding: ${xt("space.2")};
|
362
362
|
display: flex;
|
363
363
|
flex-direction: row;
|
364
|
-
`,
|
364
|
+
`,ro=i.default(_t)`
|
365
365
|
font-size: ${xt("fontSizes.3")};
|
366
366
|
font-weight: ${xt("fontWeights.bold")};
|
367
367
|
padding: 6px ${xt("space.2")};
|
368
368
|
flex-grow: 1;
|
369
|
-
`,
|
369
|
+
`,ao=({title:e,onClose:r,dialogLabelId:a})=>{const o=t.useCallback((()=>{r("close-button")}),[r]);return n.default.createElement(to,null,n.default.createElement(ro,{id:a},e),n.default.createElement(eo.CloseButton,{onClose:o}))};ao.displayName="ConfirmationHeader";const oo=i.default(_t)`
|
370
370
|
font-size: ${xt("fontSizes.1")};
|
371
371
|
padding: 0 ${xt("space.3")} ${xt("space.3")} ${xt("space.3")};
|
372
372
|
color: ${xt("colors.fg.muted")};
|
373
373
|
flex-grow: 1;
|
374
|
-
`,
|
374
|
+
`,no=({children:e})=>n.default.createElement(oo,null,e);no.displayName="ConfirmationBody";const io=i.default(_t)`
|
375
375
|
display: grid;
|
376
376
|
grid-auto-flow: column;
|
377
377
|
grid-auto-columns: max-content;
|
@@ -379,7 +379,7 @@
|
|
379
379
|
align-items: end;
|
380
380
|
justify-content: end;
|
381
381
|
padding: ${xt("space.1")} ${xt("space.3")} ${xt("space.3")};
|
382
|
-
`,
|
382
|
+
`,lo=({footerButtons:e})=>{const{containerRef:t}=Sa({bindKeys:Br.ArrowHorizontal|Br.Tab,focusInStrategy:"closest"});return n.default.createElement(io,{ref:t},n.default.createElement(eo.Buttons,{buttons:null!=e?e:[]}))};lo.displayName="ConfirmationFooter";const so=e=>{const{onClose:r,title:a,cancelButtonContent:o="Cancel",confirmButtonContent:i="OK",confirmButtonType:l="normal",children:d}=e,s=[{content:o,onClick:t.useCallback((()=>{r("cancel")}),[r])},{content:i,buttonType:l,onClick:t.useCallback((()=>{r("confirm")}),[r]),autoFocus:!0}];return n.default.createElement(eo,{onClose:r,title:a,footerButtons:s,role:"alertdialog",width:"medium",renderHeader:ao,renderBody:no,renderFooter:lo},d)};so.displayName="ConfirmationDialog";const co=i.default.div`
|
383
383
|
{
|
384
384
|
/* 6px vertical padding + 20px line height = 32px total height
|
385
385
|
*
|
@@ -395,9 +395,9 @@
|
|
395
395
|
${({variant:e})=>"filled"===e&&r.css(["background:",";margin:"," 0;border-top:1px solid ",";border-bottom:1px solid ",";&:first-child{margin-top:0;}"],xt("colors.canvas.subtle"),xt("space.2"),xt("colors.neutral.muted"),xt("colors.neutral.muted"))}
|
396
396
|
|
397
397
|
${jt}
|
398
|
-
`;function
|
398
|
+
`;function fo({variant:e="subtle",title:t,auxiliaryText:r,children:a,...o}){return n.default.createElement(co,Bt({role:"heading",variant:e},o),t,r&&n.default.createElement("span",null,r))}fo.displayName="Header";const uo=i.default.div`
|
399
399
|
${jt}
|
400
|
-
`;function
|
400
|
+
`;function go({header:e,items:t,...r}){return n.default.createElement(uo,r,e&&n.default.createElement(fo,e),t)}go.displayName="Group";const po=i.default.div`
|
401
401
|
display: ${e=>e.inline?"inline-block":"inherit"};
|
402
402
|
overflow: hidden;
|
403
403
|
text-overflow: ellipsis;
|
@@ -406,25 +406,25 @@
|
|
406
406
|
${ce}
|
407
407
|
${e=>e.expandable?"&:hover { max-width: 10000px; }":""}
|
408
408
|
${jt};
|
409
|
-
`;
|
409
|
+
`;po.defaultProps={expandable:!1,inline:!1,maxWidth:125};var bo=po;const ho=i.default.div`
|
410
410
|
height: 1px;
|
411
411
|
background: ${xt("colors.border.muted")};
|
412
412
|
margin-top: calc(${xt("space.2")} - 1px);
|
413
413
|
margin-bottom: ${xt("space.2")};
|
414
|
-
`;function
|
414
|
+
`;function mo(){return n.default.createElement(ho,null)}mo.displayName="Divider",mo.renderItem=mo;const vo=(e="default",t)=>{if(t)return{color:xt("colors.primer.fg.disabled"),iconColor:xt("colors.primer.fg.disabled"),annotationColor:xt("colors.primer.fg.disabled"),hoverCursor:"default"};switch(e){case"danger":return{color:xt("colors.danger.fg"),iconColor:xt("colors.danger.fg"),annotationColor:xt("colors.fg.muted"),hoverCursor:"pointer",hoverBg:xt("colors.actionListItem.danger.hoverBg"),focusBg:xt("colors.actionListItem.danger.activeBg"),hoverText:xt("colors.actionListItem.danger.hoverText")};default:return{color:xt("colors.fg.default"),iconColor:xt("colors.fg.muted"),annotationColor:xt("colors.fg.muted"),hoverCursor:"pointer",hoverBg:xt("colors.actionListItem.default.hoverBg"),focusBg:xt("colors.actionListItem.default.activeBg")}}},xo=i.default.div`
|
415
415
|
display: flex;
|
416
416
|
min-width: 0;
|
417
417
|
|
418
418
|
/* Required for dividers */
|
419
419
|
position: relative;
|
420
420
|
flex-grow: 1;
|
421
|
-
`,
|
421
|
+
`,yo=i.default.div`
|
422
422
|
align-items: baseline;
|
423
423
|
display: flex;
|
424
424
|
min-width: 0;
|
425
425
|
flex-direction: var(--main-content-flex-direction);
|
426
426
|
flex-grow: 1;
|
427
|
-
`,
|
427
|
+
`,wo=i.default.div`
|
428
428
|
/* 6px vertical padding + 20px line height = 32px total height
|
429
429
|
*
|
430
430
|
* TODO: When rem-based spacing on a 4px scale lands, replace
|
@@ -433,7 +433,7 @@
|
|
433
433
|
padding: 6px ${xt("space.2")};
|
434
434
|
display: flex;
|
435
435
|
border-radius: ${xt("radii.2")};
|
436
|
-
color: ${({variant:e,item:t})=>
|
436
|
+
color: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).color};
|
437
437
|
// 2 frames on a 60hz monitor
|
438
438
|
transition: background 33.333ms linear;
|
439
439
|
text-decoration: none;
|
@@ -443,18 +443,18 @@
|
|
443
443
|
// allow override in case another item in the list is active/focused
|
444
444
|
background: var(
|
445
445
|
--item-hover-bg-override,
|
446
|
-
${({variant:e,item:t})=>
|
446
|
+
${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).hoverBg}
|
447
447
|
);
|
448
|
-
color: ${({variant:e,item:t})=>
|
449
|
-
cursor: ${({variant:e,item:t})=>
|
448
|
+
color: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).hoverText};
|
449
|
+
cursor: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).hoverCursor};
|
450
450
|
}
|
451
451
|
}
|
452
452
|
|
453
453
|
// Item dividers
|
454
|
-
:not(:first-of-type):not(${
|
454
|
+
:not(:first-of-type):not(${ho} + &):not(${co} + &) {
|
455
455
|
margin-top: ${({showDivider:e})=>e?"1px":"0"};
|
456
456
|
|
457
|
-
${
|
457
|
+
${xo}::before {
|
458
458
|
content: ' ';
|
459
459
|
display: block;
|
460
460
|
position: absolute;
|
@@ -468,46 +468,46 @@
|
|
468
468
|
|
469
469
|
// Item dividers should not be visible:
|
470
470
|
// - above Hovered
|
471
|
-
&:hover ${
|
471
|
+
&:hover ${xo}::before,
|
472
472
|
// - below Hovered
|
473
473
|
// '*' instead of '&' because '&' maps to separate class names depending on 'variant'
|
474
|
-
:hover + * ${
|
474
|
+
:hover + * ${xo}::before {
|
475
475
|
// allow override in case another item in the list is active/focused
|
476
476
|
border-color: var(--item-hover-divider-border-color-override, transparent) !important;
|
477
477
|
}
|
478
478
|
|
479
479
|
// - above Focused
|
480
|
-
&:focus ${
|
480
|
+
&:focus ${xo}::before,
|
481
481
|
// - below Focused
|
482
482
|
// '*' instead of '&' because '&' maps to separate class names depending on 'variant'
|
483
|
-
:focus + * ${
|
483
|
+
:focus + * ${xo}::before,
|
484
484
|
// - above Active Descendent
|
485
|
-
&[${Er}] ${
|
485
|
+
&[${Er}] ${xo}::before,
|
486
486
|
// - below Active Descendent
|
487
|
-
[${Er}] + & ${
|
487
|
+
[${Er}] + & ${xo}::before {
|
488
488
|
// '!important' because all the ':not's above give higher specificity
|
489
489
|
border-color: transparent !important;
|
490
490
|
}
|
491
491
|
|
492
492
|
// Active Descendant
|
493
493
|
&[${Er}='${zr}'] {
|
494
|
-
background: ${({variant:e,item:t})=>
|
494
|
+
background: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).focusBg};
|
495
495
|
}
|
496
496
|
&[${Er}='${Rr}'] {
|
497
|
-
background: ${({variant:e,item:t})=>
|
497
|
+
background: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).hoverBg};
|
498
498
|
}
|
499
499
|
|
500
500
|
&:focus {
|
501
|
-
background: ${({variant:e,item:t})=>
|
501
|
+
background: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).focusBg};
|
502
502
|
outline: none;
|
503
503
|
}
|
504
504
|
|
505
505
|
&:active {
|
506
|
-
background: ${({variant:e,item:t})=>
|
506
|
+
background: ${({variant:e,item:t})=>vo(e,null==t?void 0:t.disabled).focusBg};
|
507
507
|
}
|
508
508
|
|
509
509
|
${jt}
|
510
|
-
`,
|
510
|
+
`,Bo=i.default.span``,ko=i.default.div`
|
511
511
|
// Match visual height to adjacent text line height.
|
512
512
|
// TODO: When rem-based spacing on a 4px scale lands, replace
|
513
513
|
// hardcoded '20px' with '${xt("space.s20")}'.
|
@@ -518,24 +518,24 @@
|
|
518
518
|
justify-content: center;
|
519
519
|
align-items: center;
|
520
520
|
flex-shrink: 0;
|
521
|
-
|
521
|
+
`,$o=i.default(ko)`
|
522
522
|
svg {
|
523
|
-
fill: ${({variant:e,disabled:t})=>
|
523
|
+
fill: ${({variant:e,disabled:t})=>vo(e,t).iconColor};
|
524
524
|
font-size: ${xt("fontSizes.0")};
|
525
525
|
}
|
526
|
-
|
526
|
+
`,To=i.default($o)`
|
527
527
|
display: flex;
|
528
528
|
flex-direction: column;
|
529
529
|
justify-content: center;
|
530
|
-
`,
|
531
|
-
color: ${({variant:e,disabled:t})=>
|
530
|
+
`,So=i.default($o)`
|
531
|
+
color: ${({variant:e,disabled:t})=>vo(e,t).annotationColor}};
|
532
532
|
margin-left: ${xt("space.2")};
|
533
533
|
margin-right: 0;
|
534
534
|
width: auto;
|
535
535
|
div:nth-child(2) {
|
536
536
|
margin-left: ${xt("space.2")};
|
537
537
|
}
|
538
|
-
`,
|
538
|
+
`,Co=i.default.span`
|
539
539
|
color: ${xt("colors.fg.muted")};
|
540
540
|
font-size: ${xt("fontSizes.0")};
|
541
541
|
// TODO: When rem-based spacing on a 4px scale lands, replace
|
@@ -545,7 +545,7 @@
|
|
545
545
|
min-width: 0;
|
546
546
|
flex-grow: 1;
|
547
547
|
flex-basis: var(--description-container-flex-basis);
|
548
|
-
`,
|
548
|
+
`,Eo=i.default.svg`
|
549
549
|
rect {
|
550
550
|
fill: ${({selected:e})=>xt(e?"colors.accent.fg":"colors.canvas.default")};
|
551
551
|
stroke: ${({selected:e})=>xt(e?"colors.accent.fg":"colors.border.default")};
|
@@ -556,7 +556,7 @@
|
|
556
556
|
boxshadow: ${xt("shadow.small")};
|
557
557
|
opacity: ${({selected:e})=>e?1:0};
|
558
558
|
}
|
559
|
-
`,
|
559
|
+
`,zo=n.default.forwardRef(((e,r)=>{const{as:a,text:o,description:i,descriptionVariant:l="inline",selected:d,selectionVariant:s,leadingVisual:c,trailingIcon:f,trailingVisual:u,trailingText:g,variant:p="default",showDivider:b,disabled:h,onAction:m,onKeyPress:v,children:x,onClick:y,id:w,...B}=e,k=Da(),$=Da(),T=t.useCallback((t=>{h||(null==v||v(t),!t.defaultPrevented&&[" ","Enter"].includes(t.key)&&(null==m||m(e,t)))}),[m,h,e,v]),S=t.useCallback((t=>{h||(null==y||y(t),t.defaultPrevented||null==m||m(e,t))}),[m,h,e,y]),{theme:C}=Pt();return n.default.createElement(wo,Bt({ref:r,as:a,tabIndex:h?void 0:-1,variant:p,showDivider:b,"aria-selected":d,"aria-labelledby":o?k:void 0,"aria-describedby":i?$:void 0},B,{"data-id":w,onKeyPress:T,onClick:S}),!!d===d&&n.default.createElement(ko,null,"multiple"===s?n.default.createElement(n.default.Fragment,null,n.default.createElement(Eo,{selected:d,width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true"},n.default.createElement("rect",{x:"2",y:"2",width:"12",height:"12",rx:"4"}),n.default.createElement("path",{fillRule:"evenodd",strokeWidth:"0",d:"M4.03231 8.69862C3.84775 8.20646 4.49385 7.77554 4.95539 7.77554C5.41693 7.77554 6.80154 9.85246 6.80154 9.85246C6.80154 9.85246 10.2631 4.314 10.4938 4.08323C10.7246 3.85246 11.8785 4.08323 11.4169 5.00631C11.0081 5.82388 7.26308 11.4678 7.26308 11.4678C7.26308 11.4678 6.80154 12.1602 6.34 11.4678C5.87846 10.7755 4.21687 9.19077 4.03231 8.69862Z"}))):d&&n.default.createElement(qr,{fill:null==C?void 0:C.colors.fg.default})),c&&n.default.createElement(To,{variant:p,disabled:h},n.default.createElement(c,null)),n.default.createElement(xo,null,n.default.createElement(yo,{style:{"--main-content-flex-direction":"inline"===l?"row":"column"}},x,o?n.default.createElement(Bo,{id:k},o):null,i?n.default.createElement(Co,{id:$,style:{"--description-container-margin-left":"inline"===l?xt("space.2")(C):0,"--description-container-flex-basis":"inline"===l?0:"auto"}},"block"===l?i:n.default.createElement(bo,{title:i,inline:!0,maxWidth:"100%"},i)):null),u?n.default.createElement(So,{variant:p,disabled:h},"function"==typeof u?n.default.createElement(u,null):u):f||g?n.default.createElement(So,{variant:p,disabled:h},g,f&&n.default.createElement(f,null)):null))}));zo.displayName="ActionList.Item";const Ro=i.default.div`
|
560
560
|
font-size: ${xt("fontSizes.1")};
|
561
561
|
/* 14px font-size * 1.428571429 = 20px line height
|
562
562
|
*
|
@@ -569,15 +569,15 @@
|
|
569
569
|
--item-hover-bg-override: none;
|
570
570
|
--item-hover-divider-border-color-override: ${xt("colors.border.muted")};
|
571
571
|
}
|
572
|
-
`;const
|
572
|
+
`;const Io=n.default.forwardRef(((e,t)=>{const{firstGroupStyle:r,lastGroupStyle:a,headerStyle:o,itemStyle:i}=function(e="inset"){switch(e){case"full":return{headerStyle:{paddingX:xt("space.2")},itemStyle:{borderRadius:0}};default:return{firstGroupStyle:{marginTop:xt("space.2")},lastGroupStyle:{marginBottom:xt("space.2")},itemStyle:{marginX:xt("space.2")}}}}(e.variant),l=(t,r,a)=>{var o,l,d;const s="renderItem"in t&&t.renderItem||e.renderItem||zo,c=null!==(o=null!==(l="key"in t?t.key:void 0)&&void 0!==l?l:null===(d=t.id)||void 0===d?void 0:d.toString())&&void 0!==o?o:a.toString();return n.default.createElement(s,Bt({showDivider:e.showItemDividers,selectionVariant:e.selectionVariant},t,{key:c,sx:{...i,...t.sx},item:r}))};let d=[];if(function(e){return"groupMetadata"in e}(e)){const t=e.groupMetadata.reduce(((e,t)=>e.set(t.groupId,t)),new Map);for(const r of e.items){var s,c,f;const e=t.get(r.groupId),a=null!==(s=null==e||null===(c=e.items)||void 0===c?void 0:c.length)&&void 0!==s?s:0;t.set(r.groupId,{...e,items:[...null!==(f=null==e?void 0:e.items)&&void 0!==f?f:[],l({showDivider:null==e?void 0:e.showItemDividers,...e&&"renderItem"in e&&{renderItem:e.renderItem},...r},r,a)]})}d=[...t.values()]}else d=[{items:e.items.map(((e,t)=>l(e,e,t))),groupId:"0"}];return n.default.createElement(Ro,Bt({},e,{ref:t}),d.map((({header:t,...i},l)=>{const s="filled"===(null==t?void 0:t.variant),c=l>0&&!s;return n.default.createElement(n.default.Fragment,{key:i.groupId},c?n.default.createElement(mo,{key:`${i.groupId}-divider`}):null,(t=>{var r;const a=(null!==(r="renderGroup"in t&&t.renderGroup)&&void 0!==r?r:e.renderGroup)||go;return n.default.createElement(a,Bt({},t,{key:t.groupId}))})({sx:{...0===l&&r,...l===d.length-1&&a,...l>0&&!c&&{mt:2}},...t&&{header:{...t,sx:{...o,...t.sx}}},...i}))})))}));Io.displayName="ActionList";const Ao=Object.assign(Io,{Group:go,Item:zo,Divider:mo}),No={xsmall:"192px",small:"256px",medium:"320px",large:"432px",xlarge:"600px",auto:"auto",initial:"auto"},Lo={small:"256px",medium:"320px",large:"480px",xlarge:"640px",xxlarge:"960px",auto:"auto"};const Fo=i.default.div`
|
573
573
|
background-color: ${xt("colors.canvas.overlay")};
|
574
574
|
box-shadow: ${xt("shadows.overlay.shadow")};
|
575
575
|
position: absolute;
|
576
576
|
min-width: 192px;
|
577
577
|
max-width: 640px;
|
578
|
-
height: ${e=>
|
579
|
-
max-height: ${e=>e.maxHeight&&
|
580
|
-
width: ${e=>
|
578
|
+
height: ${e=>No[e.height||"auto"]};
|
579
|
+
max-height: ${e=>e.maxHeight&&No[e.maxHeight]};
|
580
|
+
width: ${e=>Lo[e.width||"auto"]};
|
581
581
|
border-radius: 12px;
|
582
582
|
overflow: hidden;
|
583
583
|
animation: overlay-appear ${200}ms ${xt("animation.easeOutCubic")};
|
@@ -595,7 +595,7 @@
|
|
595
595
|
outline: none;
|
596
596
|
}
|
597
597
|
${jt};
|
598
|
-
`,
|
598
|
+
`,Do=n.default.forwardRef((({onClickOutside:e,role:r="none",initialFocusRef:a,returnFocusRef:o,ignoreClickRefs:i,onEscape:l,visibility:d="visible",height:s,top:c,left:f,anchorSide:u,portalContainerName:g,preventFocusOnOpen:p,...b},h)=>{const m=t.useRef(null),v=Aa(m,h),{theme:x}=Pt(),y=parseInt(xt("space.2")(x).replace("px","")),w=xt("animation.easeOutCubic")(x);return hr({overlayRef:m,returnFocusRef:o,onEscape:l,ignoreClickRefs:i,onClickOutside:e,initialFocusRef:a,preventFocusOnOpen:p}),t.useEffect((()=>{var e;"initial"===s&&null!==(e=v.current)&&void 0!==e&&e.clientHeight&&(v.current.style.height=`${v.current.clientHeight}px`)}),[s,v]),ba((()=>{var e;const{x:t,y:r}=function(e){return null!=e&&e.endsWith("bottom")?{x:0,y:-1}:null!=e&&e.endsWith("top")?{x:0,y:1}:null!=e&&e.endsWith("right")?{x:-1,y:0}:null!=e&&e.endsWith("left")?{x:1,y:0}:{x:0,y:0}}(u);(t||r)&&null!==(e=m.current)&&void 0!==e&&e.animate&&"hidden"!==d&&m.current.animate({transform:[`translate(${y*t}px, ${y*r}px)`,"translate(0, 0)"]},{duration:200,easing:w})}),[u,y,w,d]),n.default.createElement(Ia,{containerName:g},n.default.createElement(Fo,Bt({height:s,role:r},b,{ref:v,style:{top:`${c||0}px`,left:`${f||0}px`,"--styled-overlay-visibility":d}})))}));Do.defaultProps={height:"auto",width:"auto"};var Mo=Do;const Oo=({renderAnchor:e,anchorRef:r,children:a,open:o,onOpen:i,onClose:l,height:d,width:s,overlayProps:c,focusTrapSettings:f,focusZoneSettings:u,side:g,align:p})=>{const b=br(r),[h,m]=function(){const[e,r]=t.useState(null),a=t.useRef(null);a.current=e;const o=t.useCallback((e=>{a.current=e,r(e)}),[a]);return[a,o]}(),v=Da(),x=t.useCallback((()=>null==l?void 0:l("click-outside")),[l]),y=t.useCallback((()=>null==l?void 0:l("escape")),[l]),w=t.useCallback((e=>{e.defaultPrevented||!o&&["ArrowDown","ArrowUp"," ","Enter"].includes(e.key)&&(null==i||i("anchor-key-press"),e.preventDefault())}),[o,i]),B=t.useCallback((e=>{e.defaultPrevented||0!==e.button||(o?null==l||l("anchor-click"):null==i||i("anchor-click"))}),[o,i,l]),{position:k}=ha({anchorElementRef:b,floatingElementRef:h,side:g,align:p},[h.current]);return t.useEffect((()=>{!o&&h.current&&m(null)}),[o,h,m]),Sa({containerRef:h,disabled:!o||!k,...u}),Ba({containerRef:h,disabled:!o||!k,...f}),n.default.createElement(n.default.Fragment,null,e&&e({ref:b,id:v,"aria-labelledby":v,"aria-haspopup":"true",tabIndex:0,onClick:B,onKeyDown:w}),o?n.default.createElement(Mo,Bt({returnFocusRef:b,onClickOutside:x,ignoreClickRefs:[b],onEscape:y,ref:m,role:"none",visibility:k?"visible":"hidden",height:d,width:s,top:(null==k?void 0:k.top)||0,left:(null==k?void 0:k.left)||0,anchorSide:null==k?void 0:k.anchorSide},c),a):null)};Oo.displayName="AnchoredOverlay",Oo.defaultProps={side:"outside-bottom",align:"start"};const Po=e=>n.default.createElement(zo,Bt({role:"menuitem"},e));Po.displayName="ActionMenuItem",Po.displayName="ActionMenu.Item";const Ho=({anchorContent:e,renderAnchor:r=(e=>n.default.createElement(Mr,e)),anchorRef:a,onAction:o,open:i,setOpen:l,overlayProps:d,items:s,...c})=>{const[f,u]=ma(i,l,!1),g=br(a),p=t.useCallback((()=>u(!0)),[u]),b=t.useCallback((()=>u(!1)),[u]),h=t.useMemo((()=>null===r?null:t=>r({"aria-label":"menu",children:e,...t})),[e,r]),m=t.useMemo((()=>s.map((e=>({...e,role:"menuitem",onAction:(t,r)=>{var a;const n=null!==(a=e.onAction)&&void 0!==a?a:o;null==n||n(t,r),r.defaultPrevented||b()}})))),[s,o,b]);return n.default.createElement(Oo,{renderAnchor:h,anchorRef:g,open:f,onOpen:p,onClose:b,overlayProps:d},n.default.createElement(Io,Bt({},c,{role:"menu",items:m})))};Ho.displayName="ActionMenuBase",Ho.displayName="ActionMenu";const Wo=Object.assign(Ho,{Divider:mo,Item:Po}),jo=t.createContext(null);var _o={exports:{}};
|
599
599
|
/*!
|
600
600
|
Copyright (c) 2018 Jed Watson.
|
601
601
|
Licensed under the MIT License (MIT), see
|
@@ -660,7 +660,7 @@
|
|
660
660
|
${ce}
|
661
661
|
${Ko}
|
662
662
|
${jt};
|
663
|
-
`;const qo=n.default.forwardRef((({icon:e,block:t,className:r,contrast:a,disabled:o,sx:i,theme:l,width:d,minWidth:s,maxWidth:c,variant:f,...u},g)=>{const p=Uo(r,"TextInput-wrapper");return n.default.createElement(Go,{block:t,className:p,contrast:a,disabled:o,hasIcon:!!e,sx:i,theme:l,width:d,minWidth:s,maxWidth:c,variant:f},e&&n.default.createElement(e,{className:"TextInput-icon"}),n.default.createElement(Vo,Bt({ref:g,disabled:o},u)))}));qo.defaultProps={type:"text"},qo.displayName="TextInput";var Xo=qo;const Yo=n.default.forwardRef((({as:e=Xo,onFocus:r,onBlur:a,onChange:o,onKeyDown:i,onKeyUp:l,onKeyPress:d,value:s,...c},f)=>{const u=t.useContext(jo);if(null===u)throw new Error("AutocompleteContext returned null values");const{activeDescendantRef:g,autocompleteSuggestion:p="",id:b,inputRef:h,inputValue:m="",isMenuDirectlyActivated:v,setInputValue:x,setShowMenu:y,showMenu:w}=u,B=
|
663
|
+
`;const qo=n.default.forwardRef((({icon:e,block:t,className:r,contrast:a,disabled:o,sx:i,theme:l,width:d,minWidth:s,maxWidth:c,variant:f,...u},g)=>{const p=Uo(r,"TextInput-wrapper");return n.default.createElement(Go,{block:t,className:p,contrast:a,disabled:o,hasIcon:!!e,sx:i,theme:l,width:d,minWidth:s,maxWidth:c,variant:f},e&&n.default.createElement(e,{className:"TextInput-icon"}),n.default.createElement(Vo,Bt({ref:g,disabled:o},u)))}));qo.defaultProps={type:"text"},qo.displayName="TextInput";var Xo=qo;const Yo=n.default.forwardRef((({as:e=Xo,onFocus:r,onBlur:a,onChange:o,onKeyDown:i,onKeyUp:l,onKeyPress:d,value:s,...c},f)=>{const u=t.useContext(jo);if(null===u)throw new Error("AutocompleteContext returned null values");const{activeDescendantRef:g,autocompleteSuggestion:p="",id:b,inputRef:h,inputValue:m="",isMenuDirectlyActivated:v,setInputValue:x,setShowMenu:y,showMenu:w}=u,B=Aa(h,f),[k,$]=t.useState(!0),T=t.useCallback((e=>{r&&r(e),y(!0)}),[r,y]),S=t.useCallback((e=>{a&&a(e),setTimeout((()=>{document.activeElement!==B.current&&y(!1)}),0)}),[a,y,B]),C=t.useCallback((e=>{o&&o(e),x(e.currentTarget.value),w||y(!0)}),[o,x,y,w]),E=t.useCallback((e=>{var t;i&&i(e),"Backspace"===e.key&&$(!1),"Escape"===e.key&&null!==(t=h.current)&&void 0!==t&&t.value&&(x(""),h.current.value="")}),[h,x,$,i]),z=t.useCallback((e=>{l&&l(e),"Backspace"===e.key&&$(!0)}),[$,l]),R=t.useCallback((e=>{if(d&&d(e),w&&"Enter"===e.key&&g.current){e.preventDefault(),e.nativeEvent.stopImmediatePropagation();const t=new KeyboardEvent(e.type,e.nativeEvent);g.current.dispatchEvent(t)}}),[g,w,d]);return t.useEffect((()=>{h.current&&(p||(h.current.value=m),k&&p&&(m||v)&&(h.current.value=p,0===p.toLowerCase().indexOf(m.toLowerCase())&&h.current.setSelectionRange(m.length,p.length)))}),[p,m,h,v]),t.useEffect((()=>{s&&x(s.toString())}),[s,x]),n.default.createElement(e,Bt({onFocus:T,onBlur:S,onChange:C,onKeyDown:E,onKeyPress:R,onKeyUp:z,ref:B,"aria-controls":`${b}-listbox`,"aria-autocomplete":"both",role:"combobox","aria-expanded":w,"aria-haspopup":"listbox","aria-owns":`${b}-listbox`,autocomplete:"off"},c))}));Yo.displayName="AutocompleteInput";var Jo=Yo;const Zo=(e,t,r="vertical",a=8,o=0,n="smooth")=>{const i="vertical"===r?"top":"left",l="vertical"===r?"bottom":"right",d="vertical"===r?"scrollTop":"scrollLeft",{[i]:s,[l]:c}=e.getBoundingClientRect(),{[i]:f,[l]:u}=t.getBoundingClientRect(),g=c>u-a;if(s<f+o){const e=s-f+t[d];t.scrollTo({behavior:n,[i]:e-o})}else if(g){const e=c-u+t[d];t.scrollTo({behavior:n,[i]:e+a})}};function Qo(e){const r=t.useContext(jo);if(null===r)throw new Error("AutocompleteContext returned null values");const{activeDescendantRef:a,id:o,inputRef:i,inputValue:l="",scrollContainerRef:d,setAutocompleteSuggestion:s,setShowMenu:c,setInputValue:f,setIsMenuDirectlyActivated:u,setSelectedItemLength:g,showMenu:p}=r,{items:b,selectedItemIds:h,sortOnCloseFn:m,emptyStateText:v,addNewItem:x,loading:y,selectionVariant:w,filterFn:B,"aria-labelledby":k,onOpenChange:$,onSelectedChange:T,customScrollContainerRef:S}=e,C=t.useRef(null),[E,z]=t.useState(),[R,I]=t.useState(b.map((({id:e})=>e))),A=t.useMemo((()=>b.map((e=>({...e,role:"option",id:e.id,selected:"multiple"===w?h.includes(e.id):void 0,onAction:e=>{const t=h.filter((t=>t!==e.id)),r=h.includes(e.id)?t:[...t,e.id];var a,o;((T||(a=f,function(e){const{text:t=""}=Array.isArray(e)?e.slice(-1)[0]:e;a(t)}))(r.map((e=>function(e,t){return t.find((t=>t.id===e))}(e,b)))),"multiple"===w)?(f(""),s("")):(c(!1),null===(o=i.current)||void 0===o||o.setSelectionRange(i.current.value.length,i.current.value.length))}})))),[b,h,i,T,w,s,f,c]),N=t.useMemo((()=>R.reduce(((e,t,r)=>(e[t]=r,e)),{})),[R]),L=t.useMemo((()=>{return A.filter(B||(e=l,function(t,r){var a;return Boolean(null===(a=t.text)||void 0===a?void 0:a.toLowerCase().startsWith(e.toLowerCase()))})).sort(((e,t)=>N[e.id]-N[t.id]));var e}),[A,N,B,l]),F=t.useMemo((()=>[...L,...x?[{...x,leadingVisual:()=>n.default.createElement(ea,null),onAction:e=>{x.handleAddItem({...e,id:e.id||$r(),leadingVisual:void 0}),"multiple"===w&&(f(""),s(""))}}]:[]]),[L,x,s,w,f]);return Sa({containerRef:C,focusOutBehavior:"wrap",focusableElementFilter:e=>!(e instanceof HTMLInputElement),activeDescendantFocus:i,onActiveDescendantChanged:(e,t,r)=>{if(a.current=e||null,e){const t=A.find((t=>t.id.toString()===e.getAttribute("data-id")));z(t),u(r)}e&&S&&S.current&&r?Zo(e,S.current):e&&d.current&&r&&Zo(e,d.current)}},[y]),t.useEffect((()=>{var e;null!=E&&null!==(e=E.text)&&void 0!==e&&e.startsWith(l)&&!h.includes(E.id)?s(E.text):s("")}),[E,l,h,s]),t.useEffect((()=>{const e=[...R].sort(m||(t=e=>((e,t)=>t.includes(e))(e,h),(e,r)=>t(e)===t(r)?0:t(e)?-1:1));var t;const r=e.length===R.length&&e.every(((e,t)=>e===R[t]));!1!==p||r||I(e),$&&$(Boolean(p))}),[p,$,h,m,R]),t.useEffect((()=>{h.length&&g(h.length)}),[h,g]),n.default.createElement(_t,{sx:p?{}:{position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"}},y?n.default.createElement(_t,{p:3,display:"flex",justifyContent:"center"},n.default.createElement(vl,null)):n.default.createElement("div",{ref:C},F.length?n.default.createElement(Ao,{selectionVariant:"multiple",items:F,role:"listbox",id:`${o}-listbox`,"aria-labelledby":k}):n.default.createElement(_t,{p:3},v)))}function en({menuAnchorRef:e,overlayProps:r,children:a}){const o=t.useContext(jo);if(null===o)throw new Error("AutocompleteContext returned null values");const{inputRef:i,scrollContainerRef:l,selectedItemLength:d,setShowMenu:s,showMenu:c=!1}=o,{floatingElementRef:f,position:u}=ha({side:"outside-bottom",align:"start",anchorElementRef:e||i},[c,d]),g=Aa(l,f),p=t.useCallback((()=>{s(!1)}),[s]);return"undefined"==typeof window?null:n.default.createElement(Mo,Bt({returnFocusRef:i,preventFocusOnOpen:!0,onClickOutside:p,onEscape:p,ref:g,top:null==u?void 0:u.top,left:null==u?void 0:u.left,visibility:c?"visible":"hidden",sx:{overflow:"auto"}},r),a)}Qo.displayName="AutocompleteMenu",Qo.defaultProps={emptyStateText:"No selectable options",selectionVariant:"single"},Qo.displayName="AutocompleteMenu",en.displayName="AutocompleteOverlay",en.displayName="AutocompleteOverlay";const tn={inputValue:"",showMenu:!1,isMenuDirectlyActivated:!1,autocompleteSuggestion:"",selectedItemLength:0},rn=(e,t)=>{const{type:r,payload:a}=t;switch(r){case"inputValue":return{...e,inputValue:a};case"showMenu":return{...e,showMenu:a};case"isMenuDirectlyActivated":return{...e,isMenuDirectlyActivated:a};case"autocompleteSuggestion":return{...e,autocompleteSuggestion:a};case"selectedItemLength":return{...e,selectedItemLength:a};default:return e}},an=({children:e,id:r})=>{const a=t.useRef(null),o=t.useRef(null),i=t.useRef(null),[l,d]=t.useReducer(rn,tn),{inputValue:s,showMenu:c,autocompleteSuggestion:f,isMenuDirectlyActivated:u,selectedItemLength:g}=l,p=t.useCallback((e=>{d({type:"inputValue",payload:e})}),[]),b=t.useCallback((e=>{d({type:"showMenu",payload:e})}),[]),h=t.useCallback((e=>{d({type:"autocompleteSuggestion",payload:e})}),[]),m=t.useCallback((e=>{d({type:"isMenuDirectlyActivated",payload:e})}),[]),v=t.useCallback((e=>{d({type:"selectedItemLength",payload:e})}),[]),x=Da(r);return n.default.createElement(jo.Provider,{value:{activeDescendantRef:a,autocompleteSuggestion:f,id:x,inputRef:i,inputValue:s,isMenuDirectlyActivated:u,scrollContainerRef:o,selectedItemLength:g,setAutocompleteSuggestion:h,setInputValue:p,setIsMenuDirectlyActivated:m,setShowMenu:b,setSelectedItemLength:v,showMenu:c}},e)};an.displayName="Autocomplete";var on=Object.assign(an,{Input:Jo,Menu:Qo,Overlay:en});const nn=i.default.img.attrs((e=>({height:e.size,width:e.size})))`
|
664
664
|
display: inline-block;
|
665
665
|
overflow: hidden; // Ensure page layout in Firefox should images fail to load
|
666
666
|
line-height: ${xt("lineHeights.condensedUltra")};
|
@@ -857,7 +857,7 @@
|
|
857
857
|
box-shadow: ${xt("shadows.shadow.medium")};
|
858
858
|
${({size:e,variant:t="medium"})=>{const r=function(e){return!isNaN(parseFloat(e))&&isFinite(e)}(e)?e:Fn[t];return{width:r,height:r}}};
|
859
859
|
${jt};
|
860
|
-
`,Mn=i.default(
|
860
|
+
`,Mn=i.default(Ta)`
|
861
861
|
height: auto;
|
862
862
|
max-width: 60%;
|
863
863
|
max-height: 55%;
|
@@ -920,7 +920,7 @@
|
|
920
920
|
z-index: 99;
|
921
921
|
background: ${xt("colors.primer.canvas.backdrop")};
|
922
922
|
}
|
923
|
-
`,Yn=t.forwardRef((({children:e,onDismiss:r=Vn,isOpen:a,initialFocusRef:o,returnFocusRef:i,...l},d)=>{const s=t.useRef(null),c=
|
923
|
+
`,Yn=t.forwardRef((({children:e,onDismiss:r=Vn,isOpen:a,initialFocusRef:o,returnFocusRef:i,...l},d)=>{const s=t.useRef(null),c=Aa(d),f=t.useRef(null),u=()=>{r(),i&&i.current&&i.current.focus()},{getDialogProps:g}=function({modalRef:e,overlayRef:r,isOpen:a,onDismiss:o=jn,initialFocusRef:n,closeButtonRef:i}){const l=t.useCallback((t=>{e.current&&r.current&&!e.current.contains(t.target)&&r.current.contains(t.target)&&o()}),[o,e,r]);t.useEffect((()=>{if(a)return document.addEventListener("click",l),()=>{document.removeEventListener("click",l)}}),[a,l]),t.useEffect((()=>{a&&(n&&n.current?n.current.focus():i&&i.current&&i.current.focus())}),[a,n,i]);const d=t.useCallback(((t,r)=>{if(e.current){const a=Array.from(e.current.querySelectorAll("*")).filter(_n);if(0===a.length)return;t.preventDefault();const o=document.activeElement;if(!o)return;const n=a.indexOf(o)+r,i=1===r?0:a.length-1;return a[n]||a[i]}}),[e]),s=t.useCallback((e=>{const t=e.shiftKey?-1:1,r=d(e,t);r&&r.focus()}),[d]),c=t.useCallback((e=>{switch(e.key){case"Tab":s(e);break;case"Escape":o(),e.stopPropagation()}}),[s,o]);return{getDialogProps:()=>({onKeyDown:c})}}({modalRef:c,onDismiss:u,isOpen:a,initialFocusRef:o,closeButtonRef:f,returnFocusRef:i,overlayRef:s});return a?n.default.createElement(n.default.Fragment,null,n.default.createElement(Xn,{ref:s}),n.default.createElement(Kn,Bt({tabIndex:-1,ref:c,role:"dialog","aria-modal":"true"},l,g()),n.default.createElement(na,{ref:f,onClick:u,sx:{position:"absolute",top:"16px",right:"16px"}}),e)):null}));qn.defaultProps={backgroundColor:"canvas.subtle"},qn.propTypes={..._t.propTypes},qn.displayName="Dialog.Header",Yn.displayName="Dialog";var Jn=Object.assign(Yn,{Header:qn});var Zn=(e,t)=>({w:`\n top: 0;\n right: 100%;\n left: auto;\n width: auto;\n margin-top: 0;\n margin-right: 10px;\n\n &::before {\n top: 10px;\n right: -16px;\n left: auto;\n border-color: transparent;\n border-left-color: ${xt("colors.border.default")(e)};\n }\n\n &::after {\n top: 11px;\n right: -14px;\n left: auto;\n border-color: transparent;\n border-left-color: ${xt("colors.border.default")(e)};\n }\n `,e:`\n top: 0;\n left: 100%;\n width: auto;\n margin-top: 0;\n margin-left: 10px;\n\n &::before {\n top: 10px;\n left: -16px;\n border-color: transparent;\n border-right-color: ${xt("colors.border.default")(e)};\n }\n\n &::after {\n top: 11px;\n left: -14px;\n border-color: transparent;\n border-right-color: ${xt("colors.border.default")(e)};\n }\n `,ne:`\n top: auto;\n bottom: 100%;\n left: 0;\n margin-bottom: 3px;\n\n &::before,\n &::after {\n top: auto;\n right: auto;\n }\n\n &::before {\n bottom: -8px;\n left: 9px;\n border-top: 8px solid ${xt("colors.border.default")(e)};\n border-bottom: 0;\n border-left: 8px solid transparent;\n }\n\n &::after {\n bottom: -7px;\n left: 10px;\n border-top: 7px solid ${xt("colors.border.default")(e)};\n border-right: 7px solid transparent;\n border-bottom: 0;\n border-left: 7px solid transparent;\n }\n `,s:"\n right: 50%;\n left: auto;\n transform: translateX(50%);\n\n &::before {\n top: -16px;\n right: 50%;\n transform: translateX(50%);\n }\n\n &::after {\n top: -14px;\n right: 50%;\n transform: translateX(50%);\n }\n ",sw:"\n right: 0;\n left: auto;\n\n &::before {\n top: -16px;\n right: 9px;\n left: auto;\n }\n\n &::after {\n top: -14px;\n right: 10px;\n left: auto;\n }\n ",se:"\n &::before {\n top: -16px;\n left: 9px;\n }\n\n &::after {\n top: -14px;\n left: 10px;\n }\n "}[t]);const Qn=i.default(Wn)`
|
924
924
|
position: relative;
|
925
925
|
display: inline-block;
|
926
926
|
`,ei=({children:e,className:t,...r})=>{const{getDetailsProps:a}=rr({closeOnOutsideClick:!0});return n.default.createElement(Qn,Bt({className:t},a(),r),e)};ei.displayName="Dropdown";const ti=({children:e,...t})=>n.default.createElement(Mr,Bt({as:"summary","aria-haspopup":"true"},t),e,n.default.createElement(ri,null));ti.displayName="DropdownButton";const ri=i.default.div`
|
@@ -1009,7 +1009,7 @@
|
|
1009
1009
|
outline: none;
|
1010
1010
|
}
|
1011
1011
|
${jt};
|
1012
|
-
`;ai.defaultProps={direction:"sw"},ai.displayName="Dropdown.Menu",oi.displayName="Dropdown.Item",ti.defaultProps=Mr.defaultProps,ti.displayName="Dropdown.Button",ri.displayName="Dropdown.Caret",ei.defaultProps=Wn.defaultProps;var ni=Object.assign(ei,{Caret:ri,Menu:ai,Item:oi,Button:ti});const ii=n.default.forwardRef((({children:e,...t},r)=>n.default.createElement(Mr,Bt({ref:r,type:"button"},t),e,n.default.createElement(
|
1012
|
+
`;ai.defaultProps={direction:"sw"},ai.displayName="Dropdown.Menu",oi.displayName="Dropdown.Item",ti.defaultProps=Mr.defaultProps,ti.displayName="Dropdown.Button",ri.displayName="Dropdown.Caret",ei.defaultProps=Wn.defaultProps;var ni=Object.assign(ei,{Caret:ri,Menu:ai,Item:oi,Button:ti});const ii=n.default.forwardRef((({children:e,...t},r)=>n.default.createElement(Mr,Bt({ref:r,type:"button"},t),e,n.default.createElement(Ta,{icon:ra,sx:{ml:1}}))));function li({renderAnchor:e=(e=>n.default.createElement(ii,e)),anchorRef:r,placeholder:a,selectedItem:o,onChange:i,overlayProps:l,items:d,open:s,onOpenChange:c,...f}){const[u,g]=ma(s,c,!1),p=t.useCallback((()=>g(!0)),[g]),b=t.useCallback((()=>g(!1)),[g]),h=br(r),m=t.useMemo((()=>null===e?null:t=>{var r;return e({...t,children:null!==(r=null==o?void 0:o.text)&&void 0!==r?r:a})}),[a,e,null==o?void 0:o.text]),v=t.useMemo((()=>d.map((e=>({...e,role:"option",selected:e===o,onAction:(t,r)=>{var a;null===(a=e.onAction)||void 0===a||a.call(e,t,r),r.defaultPrevented||(b(),null==i||i(e===o?void 0:e))}})))),[d,i,b,o]);return n.default.createElement(Oo,{renderAnchor:m,anchorRef:h,open:u,onOpen:p,onClose:b,overlayProps:l},n.default.createElement(Io,Bt({},f,{role:"listbox",items:v})))}li.displayName="DropdownMenu",li.displayName="DropdownMenu";var di=i.default.div`
|
1013
1013
|
display: flex;
|
1014
1014
|
align-items: stretch;
|
1015
1015
|
|
@@ -1519,7 +1519,7 @@
|
|
1519
1519
|
`,il=({children:e,theme:t,...r})=>n.default.createElement(nl,Bt({theme:t},r),n.default.createElement(ol,{theme:t},e));il.displayName="SelectMenuHeader",il.displayName="SelectMenu.Header";var ll=il;const dl=r.css(["display:flex;align-items:center;padding:",";overflow:hidden;text-align:left;cursor:pointer;background-color:",";border:0;border-bottom:"," solid ",";color:",";text-decoration:none;font-size:",";font-family:inherit;width:100%;&:hover{text-decoration:none;}&:focus{outline:none;}&[hidden]{display:none !important;}@media (min-width:","){padding-top:",";padding-bottom:",";}.SelectMenu-icon{width:",";margin-right:",";flex-shrink:0;}.SelectMenu-selected-icon{visibility:hidden;transition:transform 0.12s cubic-bezier(0.5,0.1,1,0.5),visibility 0s 0.12s linear;transform:scale(0);}&[aria-checked='true']{font-weight:500;color:",";.SelectMenu-selected-icon{visibility:visible;transition:transform 0.12s cubic-bezier(0,0,0.2,1),visibility 0s linear;transform:scale(1);}}@media (hover:hover){&:hover,&:active,&:focus{background-color:",";}}@media (hover:none){&:focus,&:active{background-color:",";}-webkit-tap-highlight-color:",";}"],xt("space.3"),xt("colors.canvas.overlay"),xt("borderWidths.1"),xt("colors.border.muted"),xt("colors.fg.muted"),xt("fontSizes.0"),xt("breakpoints.0"),xt("space.2"),xt("space.2"),xt("space.3"),xt("space.2"),xt("colors.fg.default"),xt("colors.neutral.subtle"),xt("colors.canvas.subtle"),xt("colors.selectMenu.tapHighlight")),sl=i.default.a.attrs((()=>({role:"menuitemcheckbox"})))`
|
1520
1520
|
${dl}
|
1521
1521
|
${jt};
|
1522
|
-
`,cl=t.forwardRef((({children:e,selected:r,theme:a,onClick:o,...i},l)=>{const d=t.useContext(qi),s=t.useRef(null),c=null!=l?l:s;return n.default.createElement(sl,Bt({ref:c},i,{theme:a,onClick:e=>{var t;(o&&o(e),e.defaultPrevented)||(null===(t=d.setOpen)||void 0===t||t.call(d,!1))},"aria-checked":r}),n.default.createElement(
|
1522
|
+
`,cl=t.forwardRef((({children:e,selected:r,theme:a,onClick:o,...i},l)=>{const d=t.useContext(qi),s=t.useRef(null),c=null!=l?l:s;return n.default.createElement(sl,Bt({ref:c},i,{theme:a,onClick:e=>{var t;(o&&o(e),e.defaultPrevented)||(null===(t=d.setOpen)||void 0===t||t.call(d,!1))},"aria-checked":r}),n.default.createElement(Ta,{theme:a,className:"SelectMenu-icon SelectMenu-selected-icon",icon:qr}),e)}));cl.defaultProps={selected:!1},cl.displayName="SelectMenu.Item";var fl=cl;const ul=r.css(["position:relative;padding:0;margin:0;flex:auto;overflow-x:hidden;overflow-y:auto;background-color:",";-webkit-overflow-scrolling:touch;@media (hover:hover){.SelectMenuTab:focus{background-color:",";}.SelectMenuTab:not([aria-checked='true']):hover{color:",";background-color:",";}.SelectMenuTab:not([aria-checked='true']):active{color:",";background-color:",";}}"],xt("colors.canvas.overlay"),xt("colors.selectMenu.tapFocusBg"),xt("colors.fg.default"),xt("colors.canvas.subtle"),xt("colors.fg.default"),xt("colors.canvas.subtle")),gl=i.default.div`
|
1523
1523
|
${ul}
|
1524
1524
|
${jt};
|
1525
1525
|
`;gl.displayName="SelectMenu.List";var pl=gl;const bl={small:"16px",medium:"32px",large:"64px"};function hl({size:e="medium",...t}){const r=bl[e];return n.default.createElement("svg",Bt({height:r,width:r,viewBox:"0 0 16 16",fill:"none"},t),n.default.createElement("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeOpacity:"0.25",strokeWidth:"2",vectorEffect:"non-scaling-stroke"}),n.default.createElement("path",{d:"M15 8a7.002 7.002 0 00-7-7",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",vectorEffect:"non-scaling-stroke"}))}hl.displayName="Spinner";const ml=i.default(hl)`
|
@@ -1656,7 +1656,7 @@
|
|
1656
1656
|
${Yl};
|
1657
1657
|
${Jl};
|
1658
1658
|
${jt};
|
1659
|
-
`;function Ql({children:e,status:t,variant:r,...a}){const o="small"===r?{width:"1em"}:{};return n.default.createElement(Zl,Bt({},a,{variant:r,status:t}),t&&n.default.createElement(
|
1659
|
+
`;function Ql({children:e,status:t,variant:r,...a}){const o="small"===r?{width:"1em"}:{};return n.default.createElement(Zl,Bt({},a,{variant:r,status:t}),t&&n.default.createElement(Ta,Bt({},o,{icon:Xl[t]||ta,sx:{mr:1}})),e)}Ql.displayName="StateLabel",Ql.defaultProps={variant:"normal"};const ed=i.default.nav`
|
1660
1660
|
display: flex;
|
1661
1661
|
justify-content: space-between;
|
1662
1662
|
|
@@ -1863,7 +1863,7 @@
|
|
1863
1863
|
line-height: 0;
|
1864
1864
|
|
1865
1865
|
${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"))}}}
|
1866
|
-
`,Sd=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,Bt({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(Td,{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)}));Sd.displayName="Token",Sd.defaultProps={size:gd};var Cd=Sd;const Ed={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:h,minWidth:m,maxWidth:v,variant:x,visibleTokenCount:y,...w},B){const{onBlur:k,onFocus:$,onKeyDown:T,...S}=function(e){var t={};for(var r in e)fd.test(r)||(t[r]=e[r]);return t}(w),C=br(B),E=
|
1866
|
+
`,Sd=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,Bt({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(Td,{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)}));Sd.displayName="Token",Sd.defaultProps={size:gd};var Cd=Sd;const Ed={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:h,minWidth:m,maxWidth:v,variant:x,visibleTokenCount:y,...w},B){const{onBlur:k,onFocus:$,onKeyDown:T,...S}=function(e){var t={};for(var r in e)fd.test(r)||(t[r]=e[r]);return t}(w),C=br(B),E=Aa(t.useRef(null),C),[z,R]=t.useState(),[I,A]=t.useState(Boolean(y)),{containerRef:N}=Sa({focusOutBehavior:"wrap",bindKeys:Br.ArrowHorizontal|Br.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?E.current||void 0:null===(t=N.current)||void 0===t?void 0:t.children[r]}},[z]),L=e=>{c(e),setTimeout((()=>{var e,t;const r=null===(e=N.current)||void 0===e?void 0:e.children[z||0],a=r&&sr(r)?r:Array.from((null===(t=N.current)||void 0===t?void 0:t.children)||[]).find((e=>sr(e)));var o;a?a.focus():null===(o=C.current)||void 0===o||o.focus()}),0)},F=()=>{R(void 0),setTimeout((()=>{var e;null!==(e=N.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},D=e=>{var t;"Escape"===e.key&&(null===(t=C.current)||void 0===t||t.focus())},M=e=>{e.stopPropagation()},O=I?s.slice(0,y):s;return n.default.createElement(Go,{block:o,className:a,contrast:r,disabled:i,hasIcon:!!e,theme:l,width:h,minWidth:m,maxWidth:v,variant:x,onClick:()=>{var e;null===(e=E.current)||void 0===e||e.focus()},sx:{...o?{display:"flex",width:"100%"}:{},...b?{maxHeight:b,overflow:"auto"}:{},...u?{overflow:"auto"}:{},...d}},n.default.createElement(_t,{ref:N,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(_t,{sx:{order:1,flexGrow:1}},e&&n.default.createElement(e,{className:"TextInput-icon"}),n.default.createElement(Vo,Bt({ref:E,disabled:i,onFocus:e=>{$&&$(e),R(void 0),y&&A(!1)},onBlur:e=>{k&&k(e),setTimeout((()=>{var e;null!==(e=N.current)&&void 0!==e&&e.contains(document.activeElement)||!y||A(!0)}),0)},onKeyDown:e=>{var t;if(T&&T(e),null!==(t=C.current)&&void 0!==t&&t.value)return;const r=s[s.length-1];"Backspace"===e.key&&r&&(L(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%"}},S))),f?O.map((({id:e,...t},r)=>{return n.default.createElement(f,Bt({key:e,onFocus:(a=r,()=>{R(a)}),onBlur:F,onKeyUp:D,onClick:M,isSelected:z===r,onRemove:()=>{L(e)},hideRemoveButton:p,size:g,tabIndex:0},t));var a})):null,I?n.default.createElement(Un,{color:"fg.muted",fontSize:g&&Ed[g]},"+",s.length-O.length):null))}zd.displayName="TextInputWithTokensInnerComponent";const Rd=n.default.forwardRef(zd);Rd.defaultProps={tokenComponent:Cd,size:"extralarge",hideTokenRemoveButtons:!1,preventTokenWrapping:!1},Rd.displayName="TextInputWithTokens";var Id=Rd;const Ad=i.default.div`
|
1867
1867
|
display: flex;
|
1868
1868
|
flex-direction: column;
|
1869
1869
|
${e=>e.clipSidebar&&r.css([".Timeline-Item:first-child{padding-top:0;}.Timeline-Item:last-child{padding-bottom:0;}"])}
|
@@ -2210,5 +2210,5 @@
|
|
2210
2210
|
${e=>e.disabled&&"cursor: not-allowed;"}
|
2211
2211
|
|
2212
2212
|
${jt}
|
2213
|
-
`,fs=n.default.forwardRef((({checked:e,indeterminate:r,disabled:a,sx:o,required:i,validationStatus:l,...d},s)=>{const c=br(s);return t.useLayoutEffect((()=>{c.current&&(c.current.indeterminate=r||!1)}),[r,e,c]),n.default.createElement(cs,Bt({type:"checkbox",disabled:a,"aria-disabled":a?"true":"false",ref:s||c,checked:!r&&e,"aria-checked":r?"mixed":e?"true":"false",sx:o,required:i,"aria-required":i?"true":"false","aria-invalid":"error"===l?"true":"false"},d))}));fs.displayName="Checkbox";var us=fs;e.Absolute=Zt,e.ActionList=
|
2213
|
+
`,fs=n.default.forwardRef((({checked:e,indeterminate:r,disabled:a,sx:o,required:i,validationStatus:l,...d},s)=>{const c=br(s);return t.useLayoutEffect((()=>{c.current&&(c.current.indeterminate=r||!1)}),[r,e,c]),n.default.createElement(cs,Bt({type:"checkbox",disabled:a,"aria-disabled":a?"true":"false",ref:s||c,checked:!r&&e,"aria-checked":r?"mixed":e?"true":"false",sx:o,required:i,"aria-required":i?"true":"false","aria-invalid":"error"===l?"true":"false"},d))}));fs.displayName="Checkbox";var us=fs;e.Absolute=Zt,e.ActionList=Ao,e.ActionMenu=Wo,e.Autocomplete=on,e.Avatar=ln,e.AvatarPair=cn,e.AvatarStack=gn,e.AvatarToken=as,e.BaseStyles=Tt,e.BorderBox=Vt,e.Box=_t,e.BranchName=pn,e.Breadcrumb=yn,e.Breadcrumbs=xn,e.Button=Mr,e.ButtonClose=na,e.ButtonDanger=Or,e.ButtonGroup=Hr,e.ButtonInvisible=_r,e.ButtonOutline=Wr,e.ButtonPrimary=jr,e.ButtonTableList=Ur,e.Caret=Ln,e.Checkbox=us,e.CircleBadge=On,e.CircleOcticon=Pn,e.ConfirmationDialog=so,e.CounterLabel=Tn,e.Details=Wn,e.Dialog=Jn,e.Dropdown=ni,e.DropdownButton=ii,e.DropdownMenu=li,e.FilterList=gi,e.FilteredSearch=di,e.Fixed=Qt,e.Flash=hi,e.Flex=Gt,e.FormGroup=xi,e.Grid=Xt,e.Header=ki,e.Heading=$i,e.IssueLabelToken=es,e.Label=zi,e.LabelGroup=Ti,e.Link=Ii,e.NewButton=Cn,e.Overlay=Mo,e.Pagehead=Ai,e.Pagination=Di,e.PointerBox=Pi,e.Popover=ji,e.Position=Jt,e.ProgressBar=Ki,e.Relative=er,e.SSRProvider=function(e){let r=t.useContext(La),a=t.useMemo((()=>({prefix:r===Na?"":r.prefix+"-"+ ++r.current,current:0})),[r]);return n.default.createElement(La.Provider,{value:a},e.children)},e.SelectMenu=jl,e.SideNav=ql,e.Spinner=vl,e.StateLabel=Ql,e.Sticky=tr,e.StyledOcticon=Ta,e.SubNav=od,e.TabNav=sd,e.Text=Un,e.TextInput=Xo,e.TextInputWithTokens=Id,e.ThemeProvider=Wt,e.Timeline=Md,e.Token=Cd,e.Tooltip=ns,e.Truncate=bo,e.UnderlineNav=ss,e.theme=d,e.themeGet=xt,e.useColorSchemeVar=function(e,t){var r;const{colorScheme:a=""}=Pt();return null!==(r=e[a])&&void 0!==r?r:t},e.useConfirm=function(){const{theme:e,colorMode:r,dayScheme:a,nightScheme:o}=Pt();return t.useCallback((t=>async function(e,t){const{content:r,...a}=t;return new Promise((t=>{const o=document.createElement("div");l.default.render(n.default.createElement(Ot,e,n.default.createElement(so,Bt({},a,{onClose:e=>{l.default.unmountComponentAtNode(o),t("confirm"===e)}}),r)),o)}))}({theme:e,colorMode:r,dayScheme:a,nightScheme:o},t)),[e,r,a,o])},e.useDetails=rr,e.useOnEscapePress=pr,e.useOnOutsideClick=lr,e.useOpenAndCloseFocus=fr,e.useOverlay=hr,e.useSSRSafeId=Da,e.useSafeTimeout=function(){const e=t.useRef(new Set),r=t.useCallback(((t,r,...a)=>{const o=window.setTimeout(t,r,...a);return e.current.add(o),o}),[]),a=t.useCallback((t=>{clearTimeout(t),e.current.delete(t)}),[]);return t.useEffect((()=>()=>{for(const t of e.current)clearTimeout(t)}),[]),{safeSetTimeout:r,safeClearTimeout:a}},e.useTheme=Pt,Object.defineProperty(e,"__esModule",{value:!0})}));
|
2214
2214
|
//# sourceMappingURL=browser.umd.js.map
|