@odigos/ui-kit 0.0.128 → 0.0.130
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 +16 -0
- package/lib/chunks/ui-components-c940a3cc.js +2024 -0
- package/lib/chunks/vendor-55cc654c.js +1 -0
- package/lib/components/_v2/badge/index.d.ts +10 -0
- package/lib/components/_v2/button/index.d.ts +6 -3
- package/lib/components/_v2/cards/data-card/index.d.ts +12 -0
- package/lib/components/_v2/cards/index.d.ts +4 -0
- package/lib/components/_v2/cards/section-card/index.d.ts +24 -0
- package/lib/components/_v2/cards/status-card/index.d.ts +9 -0
- package/lib/components/_v2/cards/text-card/index.d.ts +12 -0
- package/lib/components/_v2/drawer/header/index.d.ts +9 -0
- package/lib/components/_v2/drawer/index.d.ts +9 -0
- package/lib/components/_v2/header/index.d.ts +7 -0
- package/lib/components/_v2/icon-button/index.d.ts +14 -0
- package/lib/components/_v2/index.d.ts +9 -0
- package/lib/components/_v2/navbar/index.d.ts +12 -0
- package/lib/components/_v2/segment/index.d.ts +14 -0
- package/lib/components/_v2/table/index.d.ts +25 -0
- package/lib/components/_v2/tag/index.d.ts +9 -0
- package/lib/components/_v2/typography/index.d.ts +4 -8
- package/lib/components/code/index.d.ts +2 -0
- package/lib/components/styled.d.ts +1 -0
- package/lib/components/tab-list/index.d.ts +2 -2
- package/lib/components/v2.js +1 -1
- package/lib/components.js +1 -1
- package/lib/constants.js +1 -1
- package/lib/containers/_v2/index.d.ts +1 -0
- package/lib/containers/_v2/pipeline-collectors/general-info/index.d.ts +7 -0
- package/lib/containers/_v2/pipeline-collectors/helpers/get-general-badge.d.ts +5 -0
- package/lib/containers/_v2/pipeline-collectors/helpers/get-general-status-card.d.ts +4 -0
- package/lib/containers/_v2/pipeline-collectors/helpers/get-general-text-cards.d.ts +4 -0
- package/lib/containers/_v2/pipeline-collectors/helpers/get-general-title.d.ts +2 -0
- package/lib/containers/_v2/pipeline-collectors/helpers/index.d.ts +4 -0
- package/lib/containers/_v2/pipeline-collectors/index.d.ts +11 -0
- package/lib/containers/_v2/pipeline-collectors/pods-info/index.d.ts +9 -0
- package/lib/containers/_v2/pipeline-collectors/pods-info/pod-drawer/index.d.ts +9 -0
- package/lib/containers/_v2/pipeline-collectors/toolbar/index.d.ts +17 -0
- package/lib/containers/v2.js +15 -0
- package/lib/containers.js +105 -105
- package/lib/functions/generate-id/index.d.ts +1 -0
- package/lib/functions/get-status-color/index.d.ts +2 -2
- package/lib/functions/get-status-from-pod-status/index.d.ts +2 -0
- package/lib/functions/get-status-icon/index.d.ts +2 -2
- package/lib/functions/index.d.ts +2 -0
- package/lib/functions.js +1 -1
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/useInfiniteScroll.d.ts +10 -0
- package/lib/hooks/useTimeAgo.d.ts +4 -3
- package/lib/hooks.js +1 -1
- package/lib/icons/{status/info-icon → common/book-icon}/index.d.ts +1 -1
- package/lib/icons/common/delete-icon/index.d.ts +2 -0
- package/lib/icons/common/dots-horizontal-icon/index.d.ts +2 -0
- package/lib/icons/common/dots-vertical-icon/index.d.ts +2 -0
- package/lib/icons/common/download-icon/index.d.ts +2 -0
- package/lib/icons/common/exclamation-circle-icon/index.d.ts +2 -0
- package/lib/icons/common/exclamation-triangle-icon/index.d.ts +2 -0
- package/lib/icons/common/expand-icon/index.d.ts +2 -0
- package/lib/icons/common/home-icon/index.d.ts +2 -0
- package/lib/icons/common/i-square-icon/index.d.ts +2 -0
- package/lib/icons/common/index.d.ts +23 -3
- package/lib/icons/common/{help-icon → question-circle-icon}/index.d.ts +1 -1
- package/lib/icons/common/refresh-icon/index.d.ts +2 -0
- package/lib/icons/common/server-disconnected-icon/index.d.ts +2 -0
- package/lib/icons/common/user-circle-icon/index.d.ts +2 -0
- package/lib/icons/common/v-icon/index.d.ts +2 -0
- package/lib/icons/common/v-square-icon/index.d.ts +2 -0
- package/lib/icons/common/x-square-icon/index.d.ts +2 -0
- package/lib/icons/index.d.ts +0 -2
- package/lib/icons/on-off/index.d.ts +2 -0
- package/lib/icons/on-off/sound-off-icon/index.d.ts +2 -0
- package/lib/icons/on-off/sound-on-icon/index.d.ts +2 -0
- package/lib/icons/overview/action-icon/index.d.ts +2 -0
- package/lib/icons/overview/data-stream-icon/index.d.ts +2 -0
- package/lib/icons/overview/destination-icon/index.d.ts +2 -0
- package/lib/icons/overview/gateway-icon/index.d.ts +2 -0
- package/lib/icons/overview/index.d.ts +12 -6
- package/lib/icons/overview/instrumentation-rule-icon/index.d.ts +2 -0
- package/lib/icons/overview/log-icon/index.d.ts +2 -0
- package/lib/icons/overview/pipeline-collector-icon/index.d.ts +2 -0
- package/lib/icons/overview/pod-icon/index.d.ts +2 -0
- package/lib/icons/overview/replica-icon/index.d.ts +2 -0
- package/lib/icons/overview/source-icon/index.d.ts +2 -0
- package/lib/icons/overview/yaml-icon/index.d.ts +2 -0
- package/lib/icons.js +1 -1
- package/lib/mock-data/index.d.ts +1 -0
- package/lib/mock-data/pipeline-collectors/index.d.ts +6 -0
- package/lib/snippets/note-back-to-summary/index.d.ts +1 -1
- package/lib/snippets.js +1 -1
- package/lib/store/useSetupStore.d.ts +1 -1
- package/lib/store.js +1 -1
- package/lib/theme/animations/index.d.ts +4 -0
- package/lib/theme/palletes/index.d.ts +5 -1
- package/lib/theme.js +1 -1
- package/lib/types/common/index.d.ts +7 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/pipeline-collectors/index.d.ts +100 -0
- package/lib/types.js +1 -1
- package/lib/visuals.js +1 -1
- package/package.json +17 -19
- package/lib/chunks/ui-components-b0804608.js +0 -1741
- package/lib/chunks/vendor-f206ac21.js +0 -1
- package/lib/icons/common/refresh-arrows-icon/index.d.ts +0 -2
- package/lib/icons/math/index.d.ts +0 -4
- package/lib/icons/overview/actions-icon/index.d.ts +0 -2
- package/lib/icons/overview/data-streams-icon/index.d.ts +0 -2
- package/lib/icons/overview/destinations-icon/index.d.ts +0 -2
- package/lib/icons/overview/rules-icon/index.d.ts +0 -2
- package/lib/icons/overview/sources-icon/index.d.ts +0 -2
- package/lib/icons/status/check-circled-icon/index.d.ts +0 -2
- package/lib/icons/status/check-icon/index.d.ts +0 -2
- package/lib/icons/status/cross-circled-icon/index.d.ts +0 -2
- package/lib/icons/status/cross-icon/index.d.ts +0 -2
- package/lib/icons/status/error-round-icon/index.d.ts +0 -2
- package/lib/icons/status/error-triangle-icon/index.d.ts +0 -2
- package/lib/icons/status/index.d.ts +0 -8
- package/lib/icons/status/warning-triangle-icon/index.d.ts +0 -2
- /package/lib/icons/{math → common}/minus-circled-icon/index.d.ts +0 -0
- /package/lib/icons/{math → common}/minus-icon/index.d.ts +0 -0
- /package/lib/icons/{math → common}/plus-circled-icon/index.d.ts +0 -0
- /package/lib/icons/{math → common}/plus-icon/index.d.ts +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import*as e from"react";import{flushSync as t}from"react-dom";function o(e,t){let o;try{o=e()}catch(e){return}return{getItem:e=>{var r;const n=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),a=null!=(r=o.getItem(e))?r:null;return a instanceof Promise?a.then(n):n(a)},setItem:(e,r)=>o.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>o.removeItem(e)}}const r=e=>t=>{try{const o=e(t);return o instanceof Promise?o:{then:e=>r(e)(o),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>r(t)(e)}}},n=(e,t)=>(n,a,s)=>{let l={storage:o(()=>localStorage),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},i=!1;const c=new Set,d=new Set;let u=l.storage;if(!u)return e((...e)=>{n(...e)},a,s);const h=()=>{const e=l.partialize({...a()});return u.setItem(l.name,{state:e,version:l.version})},f=s.setState;s.setState=(e,t)=>(f(e,t),h());const b=e((...e)=>(n(...e),h()),a,s);let p;s.getInitialState=()=>b;const x=()=>{var e,t;if(!u)return;i=!1,c.forEach(e=>{var t;return e(null!=(t=a())?t:b)});const o=(null==(t=l.onRehydrateStorage)?void 0:t.call(l,null!=(e=a())?e:b))||void 0;return r(u.getItem.bind(u))(l.name).then(e=>{if(e){if("number"!=typeof e.version||e.version===l.version)return[!1,e.state];if(l.migrate){const t=l.migrate(e.state,e.version);return t instanceof Promise?t.then(e=>[!0,e]):[!0,t]}}return[!1,void 0]}).then(e=>{var t;const[o,r]=e;if(p=l.merge(r,null!=(t=a())?t:b),n(p,!0),o)return h()}).then(()=>{null==o||o(p,void 0),p=a(),i=!0,d.forEach(e=>e(p))}).catch(e=>{null==o||o(void 0,e)})};return s.persist={setOptions:e=>{l={...l,...e},e.storage&&(u=e.storage)},clearStorage:()=>{null==u||u.removeItem(l.name)},getOptions:()=>l,rehydrate:()=>x(),hasHydrated:()=>i,onHydrate:e=>(c.add(e),()=>{c.delete(e)}),onFinishHydration:e=>(d.add(e),()=>{d.delete(e)})},l.skipHydration||x(),p||b};function a(e,t){void 0===t&&(t={});var o=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===o&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}}function s(e,t,o){let r,n=o.initialDeps??[];function a(){var a,s,l,i;let c;o.key&&(null==(a=o.debug)?void 0:a.call(o))&&(c=Date.now());const d=e();if(d.length===n.length&&!d.some((e,t)=>n[t]!==e))return r;let u;return n=d,o.key&&(null==(s=o.debug)?void 0:s.call(o))&&(u=Date.now()),r=t(...d),o.key&&(null==(l=o.debug)?void 0:l.call(o))&&(Math.round(100*(Date.now()-c)),Math.round(100*(Date.now()-u))),null==(i=null==o?void 0:o.onChange)||i.call(o,r),r}return a.updateDeps=e=>{n=e},a}function l(e,t){if(void 0===e)throw new Error("Unexpected undefined"+(t?`: ${t}`:""));return e}const i=(e,t,o)=>{let r;return function(...n){e.clearTimeout(r),r=e.setTimeout(()=>t.apply(this,n),o)}},c=e=>{const{offsetWidth:t,offsetHeight:o}=e;return{width:t,height:o}},d=e=>e,u=e=>{const t=Math.max(e.startIndex-e.overscan,0),o=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let e=t;e<=o;e++)r.push(e);return r},h=(e,t)=>{const o=e.scrollElement;if(!o)return;const r=e.targetWindow;if(!r)return;const n=e=>{const{width:o,height:r}=e;t({width:Math.round(o),height:Math.round(r)})};if(n(c(o)),!r.ResizeObserver)return()=>{};const a=new r.ResizeObserver(t=>{const r=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void n({width:t.inlineSize,height:t.blockSize})}n(c(o))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(r):r()});return a.observe(o,{box:"border-box"}),()=>{a.unobserve(o)}},f={passive:!0},b="undefined"==typeof window||"onscrollend"in window,p=(e,t)=>{const o=e.scrollElement;if(!o)return;const r=e.targetWindow;if(!r)return;let n=0;const a=e.options.useScrollendEvent&&b?()=>{}:i(r,()=>{t(n,!1)},e.options.isScrollingResetDelay),s=r=>()=>{const{horizontal:s,isRtl:l}=e.options;n=s?o.scrollLeft*(l?-1:1):o.scrollTop,a(),t(n,r)},l=s(!0),c=s(!1);c(),o.addEventListener("scroll",l,f);const d=e.options.useScrollendEvent&&b;return d&&o.addEventListener("scrollend",c,f),()=>{o.removeEventListener("scroll",l),d&&o.removeEventListener("scrollend",c)}},x=(e,t,o)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[o.options.horizontal?"inlineSize":"blockSize"])}return e[o.options.horizontal?"offsetWidth":"offsetHeight"]},g=(e,{adjustments:t=0,behavior:o},r)=>{var n,a;const s=e+t;null==(a=null==(n=r.scrollElement)?void 0:n.scrollTo)||a.call(n,{[r.options.horizontal?"left":"top"]:s,behavior:o})};class _{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this.t(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var o;null==(o=t())||o.disconnect(),e=null},observe:e=>{var o;return null==(o=t())?void 0:o.observe(e,{box:"border-box"})},unobserve:e=>{var o;return null==(o=t())?void 0:o.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,o])=>{void 0===o&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:d,rangeExtractor:u,onChange:()=>{},measureElement:x,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,o;null==(o=(t=this.options).onChange)||o.call(t,this,e)},this.maybeNotify=s(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:"production"!==process.env.NODE_ENV&&"maybeNotify",debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this.o=()=>()=>{this.cleanup()},this.l=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.i(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const o=new Map,r=new Map;for(let n=t-1;n>=0;n--){const t=e[n];if(o.has(t.lane))continue;const a=r.get(t.lane);if(null==a||t.end>a.end?r.set(t.lane,t):t.end<a.end&&o.set(t.lane,!0),o.size===this.options.lanes)break}return r.size===this.options.lanes?Array.from(r.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=s(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(e,t,o,r,n)=>(this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:o,getItemKey:r,enabled:n}),{key:!1}),this.getMeasurements=s(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:o,getItemKey:r,enabled:n},a)=>{if(!n)return this.measurementsCache=[],this.itemSizeCache.clear(),[];0===this.measurementsCache.length&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const s=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const l=this.measurementsCache.slice(0,s);for(let n=s;n<e;n++){const e=r(n),s=1===this.options.lanes?l[n-1]:this.getFurthestMeasurement(l,n),i=s?s.end+this.options.gap:t+o,c=a.get(e),d="number"==typeof c?c:this.options.estimateSize(n),u=i+d,h=s?s.lane:n%this.options.lanes;l[n]={index:n,start:i,size:d,end:u,key:e,lane:h}}return this.measurementsCache=l,l},{key:"production"!==process.env.NODE_ENV&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=s(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,o,r)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:o,lanes:r}){const n=e.length-1;if(e.length<=r)return{startIndex:0,endIndex:n};let a=w(0,n,t=>e[t].start,o),s=a;if(1===r)for(;s<n&&e[s].end<o+t;)s++;else if(r>1){const l=Array(r).fill(0);for(;s<n&&l.some(e=>e<o+t);){const t=e[s];l[t.lane]=t.end,s++}const i=Array(r).fill(o+t);for(;a>=0&&i.some(e=>e>=o);){const t=e[a];i[t.lane]=t.start,a--}a=Math.max(0,a-a%r),s=Math.min(n,s+(r-1-s%r))}return{startIndex:a,endIndex:s}}({measurements:e,outerSize:t,scrollOffset:o,lanes:r}):null,{key:"production"!==process.env.NODE_ENV&&"calculateRange",debug:()=>this.options.debug}),this.getVirtualIndexes=s(()=>{let e=null,t=null;const o=this.calculateRange();return o&&(e=o.startIndex,t=o.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,o,r,n)=>null===r||null===n?[]:e({startIndex:r,endIndex:n,overscan:t,count:o}),{key:"production"!==process.env.NODE_ENV&&"getVirtualIndexes",debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,o=e.getAttribute(t);return o?parseInt(o,10):-1},this.t=(e,t)=>{const o=this.indexFromElement(e),r=this.measurementsCache[o];if(!r)return;const n=r.key,a=this.elementsCache.get(n);a!==e&&(a&&this.observer.unobserve(a),this.observer.observe(e),this.elementsCache.set(n,e)),e.isConnected&&this.resizeItem(o,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const o=this.measurementsCache[e];if(!o)return;const r=t-(this.itemSizeCache.get(o.key)??o.size);0!==r&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(o,r,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&("production"!==process.env.NODE_ENV&&this.options.debug,this.i(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,t)),this.notify(!1))},this.measureElement=e=>{e?this.t(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=s(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const o=[];for(let r=0,n=e.length;r<n;r++){const n=t[e[r]];o.push(n)}return o},{key:"production"!==process.env.NODE_ENV&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return l(t[w(0,t.length-1,e=>l(t[e]).start,e)])},this.getOffsetForAlignment=(e,t,o=0)=>{const r=this.getSize(),n=this.getScrollOffset();"auto"===t&&(t=e>=n+r?"end":"start"),"center"===t?e+=(o-r)/2:"end"===t&&(e-=r);const a=this.getTotalSize()+this.options.scrollMargin-r;return Math.max(Math.min(a,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const o=this.measurementsCache[e];if(!o)return;const r=this.getSize(),n=this.getScrollOffset();if("auto"===t)if(o.end>=n+r-this.options.scrollPaddingEnd)t="end";else{if(!(o.start<=n+this.options.scrollPaddingStart))return[n,t];t="start"}const a="end"===t?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(a,t,o.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:o}={})=>{"smooth"===o&&this.isDynamicMode(),this.i(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:o})},this.scrollToIndex=(e,{align:t="auto",behavior:o}={})=>{"smooth"===o&&this.isDynamicMode(),e=Math.max(0,Math.min(e,this.options.count-1));let r=0;const n=t=>{if(!this.targetWindow)return;const r=this.getOffsetForIndex(e,t);if(!r)return;const[n,s]=r;this.i(n,{adjustments:void 0,behavior:o}),this.targetWindow.requestAnimationFrame(()=>{const t=this.getScrollOffset(),o=this.getOffsetForIndex(e,s);var r,n;o&&(r=o[0],n=t,Math.abs(r-n)<1.01||a(s))})},a=e=>{this.targetWindow&&(r++,r<10&&("production"!==process.env.NODE_ENV&&this.options.debug,this.targetWindow.requestAnimationFrame(()=>n(e))))};n(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode(),this.i(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let o;if(0===t.length)o=this.options.paddingStart;else if(1===this.options.lanes)o=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let r=t.length-1;for(;r>=0&&e.some(e=>null===e);){const o=t[r];null===e[o.lane]&&(e[o.lane]=o.end),r--}o=Math.max(...e.filter(e=>null!==e))}return Math.max(o-this.options.scrollMargin+this.options.paddingEnd,0)},this.i=(e,{adjustments:t,behavior:o})=>{this.options.scrollToFn(e,{behavior:o,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const w=(e,t,o,r)=>{for(;e<=t;){const n=(e+t)/2|0,a=o(n);if(a<r)e=n+1;else{if(!(a>r))return n;t=n-1}}return e>0?e-1:0},y="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;function m(o){return function(o){const r=e.useReducer(()=>({}),{})[1],n={...o,onChange:(e,n)=>{var a;n?t(r):r(),null==(a=o.onChange)||a.call(o,e,n)}},[a]=e.useState(()=>new _(n));return a.setOptions(n),y(()=>a.o(),[]),y(()=>a.l()),a}({observeElementRect:h,observeElementOffset:p,scrollToFn:g,...o})}var v={locale:"en",long:{year:{previous:"last year",current:"this year",next:"next year",past:{one:"{0} year ago",other:"{0} years ago"},future:{one:"in {0} year",other:"in {0} years"}},quarter:{previous:"last quarter",current:"this quarter",next:"next quarter",past:{one:"{0} quarter ago",other:"{0} quarters ago"},future:{one:"in {0} quarter",other:"in {0} quarters"}},month:{previous:"last month",current:"this month",next:"next month",past:{one:"{0} month ago",other:"{0} months ago"},future:{one:"in {0} month",other:"in {0} months"}},week:{previous:"last week",current:"this week",next:"next week",past:{one:"{0} week ago",other:"{0} weeks ago"},future:{one:"in {0} week",other:"in {0} weeks"}},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:{one:"{0} hour ago",other:"{0} hours ago"},future:{one:"in {0} hour",other:"in {0} hours"}},minute:{current:"this minute",past:{one:"{0} minute ago",other:"{0} minutes ago"},future:{one:"in {0} minute",other:"in {0} minutes"}},second:{current:"now",past:{one:"{0} second ago",other:"{0} seconds ago"},future:{one:"in {0} second",other:"in {0} seconds"}}},short:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0} yr. ago",future:"in {0} yr."},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:{one:"{0} qtr. ago",other:"{0} qtrs. ago"},future:{one:"in {0} qtr.",other:"in {0} qtrs."}},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0} mo. ago",future:"in {0} mo."},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0} wk. ago",future:"in {0} wk."},day:{previous:"yesterday",current:"today",next:"tomorrow",past:{one:"{0} day ago",other:"{0} days ago"},future:{one:"in {0} day",other:"in {0} days"}},hour:{current:"this hour",past:"{0} hr. ago",future:"in {0} hr."},minute:{current:"this minute",past:"{0} min. ago",future:"in {0} min."},second:{current:"now",past:"{0} sec. ago",future:"in {0} sec."}},narrow:{year:{previous:"last yr.",current:"this yr.",next:"next yr.",past:"{0}y ago",future:"in {0}y"},quarter:{previous:"last qtr.",current:"this qtr.",next:"next qtr.",past:"{0}q ago",future:"in {0}q"},month:{previous:"last mo.",current:"this mo.",next:"next mo.",past:"{0}mo ago",future:"in {0}mo"},week:{previous:"last wk.",current:"this wk.",next:"next wk.",past:"{0}w ago",future:"in {0}w"},day:{previous:"yesterday",current:"today",next:"tomorrow",past:"{0}d ago",future:"in {0}d"},hour:{current:"this hour",past:"{0}h ago",future:"in {0}h"},minute:{current:"this minute",past:"{0}m ago",future:"in {0}m"},second:{current:"now",past:"{0}s ago",future:"in {0}s"}},now:{now:{current:"now",future:"in a moment",past:"just now"}},mini:{year:"{0}yr",month:"{0}mo",week:"{0}wk",day:"{0}d",hour:"{0}h",minute:"{0}m",second:"{0}s",now:"now"},"short-time":{year:"{0} yr.",month:"{0} mo.",week:"{0} wk.",day:{one:"{0} day",other:"{0} days"},hour:"{0} hr.",minute:"{0} min.",second:"{0} sec."},"long-time":{year:{one:"{0} year",other:"{0} years"},month:{one:"{0} month",other:"{0} months"},week:{one:"{0} week",other:"{0} weeks"},day:{one:"{0} day",other:"{0} days"},hour:{one:"{0} hour",other:"{0} hours"},minute:{one:"{0} minute",other:"{0} minutes"},second:{one:"{0} second",other:"{0} seconds"}}};a(".react-flow{--xy-edge-stroke-default:#b1b1b7;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#555;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:hsla(0,0%,100%,.5);--xy-minimap-background-color-default:#fff;--xy-minimap-mask-background-color-default:hsla(0,0%,94%,.6);--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#e2e2e2;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:transparent;--xy-background-pattern-dots-color-default:#91919a;--xy-background-pattern-lines-color-default:#eee;--xy-background-pattern-cross-color-default:#e2e2e2;--xy-node-color-default:inherit;--xy-node-border-default:1px solid #1a192b;--xy-node-background-color-default:#fff;--xy-node-group-background-color-default:hsla(0,0%,94%,.25);--xy-node-boxshadow-hover-default:0 1px 4px 1px rgba(0,0,0,.08);--xy-node-boxshadow-selected-default:0 0 0 0.5px #1a192b;--xy-node-border-radius-default:3px;--xy-handle-background-color-default:#1a192b;--xy-handle-border-color-default:#fff;--xy-selection-background-color-default:rgba(0,89,220,.08);--xy-selection-border-default:1px dotted rgba(0,89,220,.8);--xy-controls-button-background-color-default:#fefefe;--xy-controls-button-background-color-hover-default:#f4f4f4;--xy-controls-button-color-default:inherit;--xy-controls-button-color-hover-default:inherit;--xy-controls-button-border-color-default:#eee;--xy-controls-box-shadow-default:0 0 2px 1px rgba(0,0,0,.08);--xy-edge-label-background-color-default:#fff;--xy-edge-label-color-default:inherit;--xy-resize-background-color-default:#3367d9;background-color:var(--xy-background-color,var(--xy-background-color-default));direction:ltr}.react-flow.dark{--xy-edge-stroke-default:#3e3e3e;--xy-edge-stroke-width-default:1;--xy-edge-stroke-selected-default:#727272;--xy-connectionline-stroke-default:#b1b1b7;--xy-connectionline-stroke-width-default:1;--xy-attribution-background-color-default:hsla(0,0%,59%,.25);--xy-minimap-background-color-default:#141414;--xy-minimap-mask-background-color-default:rgba(60,60,60,.6);--xy-minimap-mask-stroke-color-default:transparent;--xy-minimap-mask-stroke-width-default:1;--xy-minimap-node-background-color-default:#2b2b2b;--xy-minimap-node-stroke-color-default:transparent;--xy-minimap-node-stroke-width-default:2;--xy-background-color-default:#141414;--xy-background-pattern-dots-color-default:#777;--xy-background-pattern-lines-color-default:#777;--xy-background-pattern-cross-color-default:#777;--xy-node-color-default:#f8f8f8;--xy-node-border-default:1px solid #3c3c3c;--xy-node-background-color-default:#1e1e1e;--xy-node-group-background-color-default:hsla(0,0%,94%,.25);--xy-node-boxshadow-hover-default:0 1px 4px 1px hsla(0,0%,100%,.08);--xy-node-boxshadow-selected-default:0 0 0 0.5px #999;--xy-handle-background-color-default:#bebebe;--xy-handle-border-color-default:#1e1e1e;--xy-selection-background-color-default:rgba(200,200,220,.08);--xy-selection-border-default:1px dotted rgba(200,200,220,.8);--xy-controls-button-background-color-default:#2b2b2b;--xy-controls-button-background-color-hover-default:#3e3e3e;--xy-controls-button-color-default:#f8f8f8;--xy-controls-button-color-hover-default:#fff;--xy-controls-button-border-color-default:#5b5b5b;--xy-controls-box-shadow-default:0 0 2px 1px rgba(0,0,0,.08);--xy-edge-label-background-color-default:#141414;--xy-edge-label-color-default:#f8f8f8}.react-flow__background{background-color:var(--xy-background-color-props,var(--xy-background-color,var(--xy-background-color-default)));pointer-events:none;z-index:-1}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{z-index:1}.react-flow__pane.draggable{cursor:grab}.react-flow__pane.dragging{cursor:grabbing}.react-flow__pane.selection{cursor:pointer}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow__edge-path{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default));stroke-width:var(--xy-edge-stroke-width,var(--xy-edge-stroke-width-default));fill:none}.react-flow__connection-path{stroke:var(--xy-connectionline-stroke,var(--xy-connectionline-stroke-default));stroke-width:var(--xy-connectionline-stroke-width,var(--xy-connectionline-stroke-width-default));fill:none}.react-flow .react-flow__edges{position:absolute}.react-flow .react-flow__edges svg{overflow:visible;pointer-events:none;position:absolute}.react-flow__edge{pointer-events:visibleStroke}.react-flow__edge.selectable{cursor:pointer}.react-flow__edge.animated path{stroke-dasharray:5;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selectable:focus .react-flow__edge-path,.react-flow__edge.selectable:focus-visible .react-flow__edge-path,.react-flow__edge.selected .react-flow__edge-path{stroke:var(--xy-edge-stroke-selected,var(--xy-edge-stroke-selected-default))}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__arrowhead polyline{stroke:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__arrowhead polyline.arrowclosed{fill:var(--xy-edge-stroke,var(--xy-edge-stroke-default))}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;animation:dashdraw .5s linear infinite}svg.react-flow__connectionline{overflow:visible;position:absolute;z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:default;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.selectable{cursor:pointer}.react-flow__node.draggable{cursor:grab;pointer-events:all}.react-flow__node.draggable.dragging{cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background-color:var(--xy-handle-background-color,var(--xy-handle-background-color-default));border:1px solid var(--xy-handle-border-color,var(--xy-handle-border-color-default));border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectingfrom{pointer-events:all}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:0;left:50%;top:auto;transform:translate(-50%,50%)}.react-flow__handle-top{left:50%;top:0;transform:translate(-50%,-50%)}.react-flow__handle-left{left:0;top:50%;transform:translate(-50%,-50%)}.react-flow__handle-right{right:0;top:50%;transform:translate(50%,-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__pane.selection .react-flow__panel{pointer-events:none}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.bottom.center,.react-flow__panel.top.center{left:50%;transform:translateX(-15px) translateX(-50%)}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.left.center,.react-flow__panel.right.center{top:50%;transform:translateY(-15px) translateY(-50%)}.react-flow__attribution{background:var(--xy-attribution-background-color,var(--xy-attribution-background-color-default));font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{pointer-events:none}.react-flow__edgelabel-renderer,.react-flow__viewport-portal{height:100%;left:0;position:absolute;top:0;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__minimap{background:var(\n --xy-minimap-background-color-props,var(--xy-minimap-background-color,var(--xy-minimap-background-color-default))\n )}.react-flow__minimap-svg{display:block}.react-flow__minimap-mask{fill:var(\n --xy-minimap-mask-background-color-props,var(--xy-minimap-mask-background-color,var(--xy-minimap-mask-background-color-default))\n );stroke:var(\n --xy-minimap-mask-stroke-color-props,var(--xy-minimap-mask-stroke-color,var(--xy-minimap-mask-stroke-color-default))\n );stroke-width:var(\n --xy-minimap-mask-stroke-width-props,var(--xy-minimap-mask-stroke-width,var(--xy-minimap-mask-stroke-width-default))\n )}.react-flow__minimap-node{fill:var(\n --xy-minimap-node-background-color-props,var(--xy-minimap-node-background-color,var(--xy-minimap-node-background-color-default))\n );stroke:var(\n --xy-minimap-node-stroke-color-props,var(--xy-minimap-node-stroke-color,var(--xy-minimap-node-stroke-color-default))\n );stroke-width:var(\n --xy-minimap-node-stroke-width-props,var(--xy-minimap-node-stroke-width,var(--xy-minimap-node-stroke-width-default))\n )}.react-flow__background-pattern.dots{fill:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-dots-color-default))\n )}.react-flow__background-pattern.lines{stroke:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-lines-color-default))\n )}.react-flow__background-pattern.cross{stroke:var(\n --xy-background-pattern-color-props,var(--xy-background-pattern-color,var(--xy-background-pattern-cross-color-default))\n )}.react-flow__controls{box-shadow:var(--xy-controls-box-shadow,var(--xy-controls-box-shadow-default));display:flex;flex-direction:column}.react-flow__controls.horizontal{flex-direction:row}.react-flow__controls-button{align-items:center;background:var(--xy-controls-button-background-color,var(--xy-controls-button-background-color-default));border:none;border-bottom:1px solid var(\n --xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default))\n );color:var(\n --xy-controls-button-color-props,var(--xy-controls-button-color,var(--xy-controls-button-color-default))\n );cursor:pointer;display:flex;height:26px;justify-content:center;padding:4px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:26px}.react-flow__controls-button svg{fill:currentColor;max-height:12px;max-width:12px;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:var(--xy-node-background-color,var(--xy-node-background-color-default));border:var(--xy-node-border,var(--xy-node-border-default));border-radius:var(--xy-node-border-radius,var(--xy-node-border-radius-default));color:var(--xy-node-color,var(--xy-node-color-default));font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:var(--xy-node-boxshadow-hover,var(--xy-node-boxshadow-hover-default))}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:var(--xy-node-boxshadow-selected,var(--xy-node-boxshadow-selected-default))}.react-flow__node-group{background-color:var(--xy-node-group-background-color,var(--xy-node-group-background-color-default))}.react-flow__nodesselection-rect,.react-flow__selection{background:var(--xy-selection-background-color,var(--xy-selection-background-color-default));border:var(--xy-selection-border,var(--xy-selection-border-default))}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls-button:hover{background:var(\n --xy-controls-button-background-color-hover-props,var(--xy-controls-button-background-color-hover,var(--xy-controls-button-background-color-hover-default))\n );color:var(\n --xy-controls-button-color-hover-props,var(--xy-controls-button-color-hover,var(--xy-controls-button-color-hover-default))\n )}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__controls-button:last-child{border-bottom:none}.react-flow__controls.horizontal .react-flow__controls-button{border-bottom:none;border-right:1px solid var(\n --xy-controls-button-border-color-props,var(--xy-controls-button-border-color,var(--xy-controls-button-border-color-default))\n )}.react-flow__controls.horizontal .react-flow__controls-button:last-child{border-right:none}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border:1px solid #fff;border-radius:1px;height:5px;translate:-50% -50%;width:5px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border-color:var(--xy-resize-background-color,var(--xy-resize-background-color-default));border-style:solid;border-width:0}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}.react-flow__edge-textbg{fill:var(--xy-edge-label-background-color,var(--xy-edge-label-background-color-default))}.react-flow__edge-text{fill:var(--xy-edge-label-color,var(--xy-edge-label-color-default))}");export{o as c,v as e,n as p,a as s,m as u};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type SVG, StatusType, OtherStatusType } from '@/types';
|
|
3
|
+
export interface BadgeProps {
|
|
4
|
+
label: string | number;
|
|
5
|
+
leftIcon?: SVG;
|
|
6
|
+
rightIcon?: SVG;
|
|
7
|
+
status?: StatusType | OtherStatusType;
|
|
8
|
+
useSecondaryTone?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const Badge: FC<BadgeProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ButtonHTMLAttributes
|
|
2
|
-
import type { SVG } from '@/types';
|
|
1
|
+
import React, { type ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import type { SVG, SVGProps } from '@/types';
|
|
3
3
|
export declare enum ButtonVariants {
|
|
4
4
|
Primary = "primary",
|
|
5
5
|
Secondary = "secondary",
|
|
@@ -16,6 +16,9 @@ export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
|
16
16
|
rightIcon?: SVG;
|
|
17
17
|
variant?: ButtonVariants;
|
|
18
18
|
size?: ButtonSize;
|
|
19
|
+
iconSize?: SVGProps['size'];
|
|
19
20
|
loading?: boolean;
|
|
21
|
+
fullWidth?: boolean;
|
|
22
|
+
withShadow?: boolean;
|
|
20
23
|
}
|
|
21
|
-
export declare const Button:
|
|
24
|
+
export declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type BadgeProps } from '../../badge';
|
|
3
|
+
export interface DataCardProps {
|
|
4
|
+
cellsPerRow: number;
|
|
5
|
+
items: {
|
|
6
|
+
id: string;
|
|
7
|
+
title: string;
|
|
8
|
+
label?: string;
|
|
9
|
+
badge?: BadgeProps;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare const DataCard: FC<DataCardProps>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type ReactNode, type FC } from 'react';
|
|
2
|
+
import type { SVG } from '@/types';
|
|
3
|
+
import { type BadgeProps } from '../../badge';
|
|
4
|
+
import { type ButtonProps } from '../../button';
|
|
5
|
+
export declare enum SectionCardSize {
|
|
6
|
+
S = "small",
|
|
7
|
+
M = "medium"
|
|
8
|
+
}
|
|
9
|
+
export declare enum SectionCardActionType {
|
|
10
|
+
Button = "button"
|
|
11
|
+
}
|
|
12
|
+
export interface SectionCardProps {
|
|
13
|
+
size?: SectionCardSize;
|
|
14
|
+
icon: SVG;
|
|
15
|
+
title: string;
|
|
16
|
+
badge?: BadgeProps;
|
|
17
|
+
actions?: {
|
|
18
|
+
id: string;
|
|
19
|
+
type: SectionCardActionType;
|
|
20
|
+
props: ButtonProps;
|
|
21
|
+
}[];
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const SectionCard: FC<SectionCardProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type SVG, StatusType, OtherStatusType } from '@/types';
|
|
3
|
+
export interface StatusCardProps {
|
|
4
|
+
status: StatusType | OtherStatusType;
|
|
5
|
+
icon?: SVG;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const StatusCard: FC<StatusCardProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React, { type FC } from 'react';
|
|
2
|
+
import { HeaderProps } from './header';
|
|
3
|
+
export interface DrawerProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
position?: 'left' | 'right';
|
|
6
|
+
header: HeaderProps;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const Drawer: FC<DrawerProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import type { SVG } from '@/types';
|
|
3
|
+
export declare enum IconButtonSize {
|
|
4
|
+
XS = 16,
|
|
5
|
+
S = 18,
|
|
6
|
+
M = 24,
|
|
7
|
+
L = 32
|
|
8
|
+
}
|
|
9
|
+
export interface IconButtonProps {
|
|
10
|
+
icon: SVG;
|
|
11
|
+
size?: IconButtonSize;
|
|
12
|
+
onClick: () => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const IconButton: FC<IconButtonProps>;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
+
export * from './badge';
|
|
1
2
|
export * from './button';
|
|
2
3
|
export * from './button-tab';
|
|
3
4
|
export * from './button-tab-list';
|
|
5
|
+
export * from './cards';
|
|
4
6
|
export * from './checkbox';
|
|
5
7
|
export * from './checkbox-list';
|
|
8
|
+
export * from './drawer';
|
|
9
|
+
export * from './header';
|
|
10
|
+
export * from './icon-button';
|
|
6
11
|
export * from './input';
|
|
7
12
|
export * from './modal';
|
|
13
|
+
export * from './navbar';
|
|
8
14
|
export * from './note';
|
|
9
15
|
export * from './radio';
|
|
10
16
|
export * from './radio-group';
|
|
17
|
+
export * from './segment';
|
|
18
|
+
export * from './table';
|
|
19
|
+
export * from './tag';
|
|
11
20
|
export * from './typography';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type CSSProperties, type FC } from 'react';
|
|
2
|
+
import type { SVG } from '@/types';
|
|
3
|
+
export interface NavbarProps {
|
|
4
|
+
height: CSSProperties['height'];
|
|
5
|
+
icons: {
|
|
6
|
+
id: string;
|
|
7
|
+
icon: SVG;
|
|
8
|
+
selected: boolean;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
}[];
|
|
11
|
+
}
|
|
12
|
+
export declare const Navbar: FC<NavbarProps>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SVG } from '@/types';
|
|
3
|
+
interface Option<T> {
|
|
4
|
+
value: T;
|
|
5
|
+
label?: string;
|
|
6
|
+
icon?: SVG;
|
|
7
|
+
}
|
|
8
|
+
export interface SegmentProps<T = any> {
|
|
9
|
+
options: Option<T>[];
|
|
10
|
+
selected: T;
|
|
11
|
+
setSelected: (value: T) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const Segment: <T>({ options, selected, setSelected }: SegmentProps<T>) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type CSSProperties, type FC } from 'react';
|
|
2
|
+
interface Column {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
sortable?: boolean;
|
|
6
|
+
minWidth?: CSSProperties['minWidth'];
|
|
7
|
+
textAlign?: CSSProperties['textAlign'];
|
|
8
|
+
}
|
|
9
|
+
interface RowCell {
|
|
10
|
+
key: string;
|
|
11
|
+
rawValue: string | number | boolean;
|
|
12
|
+
component?: FC;
|
|
13
|
+
}
|
|
14
|
+
interface Row {
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
cells: RowCell[];
|
|
17
|
+
}
|
|
18
|
+
export interface TableProps {
|
|
19
|
+
maxHeight?: CSSProperties['maxHeight'];
|
|
20
|
+
isLoading?: boolean;
|
|
21
|
+
columns: Column[];
|
|
22
|
+
rows: Row[];
|
|
23
|
+
}
|
|
24
|
+
export declare const Table: FC<TableProps>;
|
|
25
|
+
export {};
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import React, { FC } from 'react';
|
|
2
|
-
import { CSSProperties } from 'styled-components';
|
|
1
|
+
import React, { type FC, type CSSProperties } from 'react';
|
|
3
2
|
export declare enum TypographyVariants {
|
|
4
3
|
H1 = "h1",
|
|
5
4
|
H2 = "h2",
|
|
@@ -11,6 +10,7 @@ export declare enum TypographyVariants {
|
|
|
11
10
|
Span = "span"
|
|
12
11
|
}
|
|
13
12
|
export declare enum TypographySize {
|
|
13
|
+
XXXS = "xxxs",
|
|
14
14
|
XXS = "xxs",
|
|
15
15
|
XS = "xs",
|
|
16
16
|
S = "s",
|
|
@@ -20,19 +20,15 @@ export declare enum TypographySize {
|
|
|
20
20
|
XXL = "xxl",
|
|
21
21
|
XXXL = "xxxl"
|
|
22
22
|
}
|
|
23
|
-
export declare enum TypographyAlign {
|
|
24
|
-
Left = "left",
|
|
25
|
-
Right = "right",
|
|
26
|
-
Center = "center"
|
|
27
|
-
}
|
|
28
23
|
export interface TypographyProps {
|
|
29
24
|
children: React.ReactNode;
|
|
30
25
|
variant?: TypographyVariants;
|
|
31
26
|
color?: CSSProperties['color'];
|
|
32
27
|
size?: TypographySize;
|
|
33
28
|
weight?: CSSProperties['fontWeight'];
|
|
34
|
-
align?:
|
|
29
|
+
align?: CSSProperties['textAlign'];
|
|
35
30
|
transform?: CSSProperties['textTransform'];
|
|
36
31
|
lineHeight?: CSSProperties['lineHeight'];
|
|
32
|
+
nowrap?: boolean;
|
|
37
33
|
}
|
|
38
34
|
export declare const Typography: FC<TypographyProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties } from 'styled-components';
|
|
2
|
+
export declare const PageContent: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, never>> & string;
|
|
2
3
|
export declare const FlexRow: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
3
4
|
$gap?: number;
|
|
4
5
|
$alignItems?: CSSProperties["alignItems"];
|
|
@@ -10,8 +10,8 @@ interface TabListProps {
|
|
|
10
10
|
tabs?: Tab[];
|
|
11
11
|
hideBorder?: boolean;
|
|
12
12
|
}
|
|
13
|
-
declare const Tab: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<
|
|
13
|
+
declare const Tab: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
|
|
14
14
|
$selected?: boolean;
|
|
15
|
-
}>> & string
|
|
15
|
+
}>> & string;
|
|
16
16
|
declare const TabList: FC<TabListProps>;
|
|
17
17
|
export { TabList, type TabListProps, type Tab };
|
package/lib/components/v2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{cX as Badge,n as Button,B as ButtonSize,cY as ButtonTab,cZ as ButtonTabList,h as ButtonVariants,d0 as Checkbox,d2 as CheckboxList,d1 as CheckboxListDirection,c$ as CheckboxSize,d as DataCard,D as Drawer,d3 as Header,I as IconButton,d4 as IconButtonSize,d5 as Input,d6 as Modal,d7 as Navbar,d8 as Note,da as Radio,dc as RadioGroup,db as RadioGroupDirection,d9 as RadioSize,S as SectionCard,f as SectionCardActionType,c_ as SectionCardSize,m as Segment,o as StatusCard,j as Table,dd as Tag,p as TextCard,e as Typography,l as TypographySize,de as TypographyVariants}from"../chunks/ui-components-c940a3cc.js";import"../icons.js";import"react";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/components.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{ai as AutocompleteInput,aD as Badge,aG as Button,a3 as CancelWarning,C as CenterThis,v as Checkbox,i as Code,a9 as ConditionDetails,aa as DataCard,s as DataCardFieldTypes,br as DataCardFields,cL as DataFinger,aJ as DataTab,a2 as DeleteWarning,bO as DescribeRow,aj as Divider,U as DocsButton,a1 as Drawer,cN as DrawerFooter,cM as DrawerHeader,b4 as Dropdown,cO as ErrorBoundary,bd as ExtendArrow,F as FadeLoader,w as FieldError,t as FieldLabel,c as FlexColumn,k as FlexRow,cP as Header,bc as IconButton,bX as IconGroup,ax as IconTitleBadge,as as IconWrapped,bK as IconsNav,cQ as ImageControlled,y as Input,L as InputList,G as InputTable,aA as InteractiveTable,J as KeyValueInputsList,aF as LoadingText,ad as Modal,af as ModalBody,V as MonitorsCheckboxes,au as MonitorsIcons,ae as NavigationButtons,aB as NoDataFound,ag as NotificationNote,cW as Overlay,P as PageContent,a$ as Popup,b$ as PopupForm,c4 as ScrollX,aN as ScrollY,R as SectionTitle,Q as Segment,b0 as SelectionButton,aR as SkeletonLoader,al as Status,bq as Stepper,cR as TabList,av as TableContainer,aw as TableTitleWrap,az as TableWrap,bA as Tag,N as Text,X as TextArea,H as Toggle,c2 as ToggleCodeComponent,an as Tooltip,aC as TraceLoader,b1 as VerticalScroll,cV as WarningModal,cS as getLinksFromText,cT as getStrongsFromText,cU as renderText}from"./chunks/ui-components-c940a3cc.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
package/lib/constants.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{a7 as ACTION_OPTIONS,a0 as BUTTON_TEXTS,bb as DEFAULT_DATA_STREAM_NAME,bo as DESTINATION_CATEGORIES,b5 as DISPLAY_LANGUAGES,r as DISPLAY_TITLES,ah as FORM_ALERTS,bD as INSTRUMENTATION_RULE_OPTIONS,cE as LANGUAGE_OPTIONS,b6 as MONITORS_OPTIONS,b7 as STORAGE_KEYS,cF as TOKEN_ABOUT_TO_EXPIRE}from"./chunks/ui-components-c940a3cc.js";import"./icons.js";import"react";import"zustand";import"javascript-time-ago";import"./chunks/vendor-55cc654c.js";import"react-dom";import"styled-components";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './pipeline-collectors';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type SectionCardProps, type StatusCardProps, type TextCardProps } from '@/components/_v2';
|
|
3
|
+
export interface GeneralInfoProps extends SectionCardProps {
|
|
4
|
+
statusCard: StatusCardProps;
|
|
5
|
+
textCards: TextCardProps[];
|
|
6
|
+
}
|
|
7
|
+
export declare const GeneralInfo: FC<GeneralInfoProps>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tabs } from '../toolbar';
|
|
2
|
+
import { type FormatTimeAgo } from '@/hooks';
|
|
3
|
+
import { type BadgeProps } from '@/components/_v2';
|
|
4
|
+
import { type GatewayInfo, type NodeCollectoInfo } from '@/types';
|
|
5
|
+
export declare const getGeneralBadge: (selectedTab: Tabs, gatewayInfo: GatewayInfo | null, nodeCollectorInfo: NodeCollectoInfo | null, formatTimeAgo: FormatTimeAgo) => BadgeProps;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tabs } from '../toolbar';
|
|
2
|
+
import { type StatusCardProps } from '@/components/_v2';
|
|
3
|
+
import { type GatewayInfo, type NodeCollectoInfo } from '@/types';
|
|
4
|
+
export declare const getGeneralStatusCard: (selectedTab: Tabs, gatewayInfo: GatewayInfo | null, nodeCollectorInfo: NodeCollectoInfo | null, isLoading: boolean) => StatusCardProps;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { Tabs } from '../toolbar';
|
|
2
|
+
import { type TextCardProps } from '@/components/_v2';
|
|
3
|
+
import { type GatewayInfo, type NodeCollectoInfo } from '@/types';
|
|
4
|
+
export declare const getGeneralTextCards: (selectedTab: Tabs, gatewayInfo: GatewayInfo | null, nodeCollectorInfo: NodeCollectoInfo | null, isLoading: boolean) => TextCardProps[];
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FC, type CSSProperties } from 'react';
|
|
2
|
+
import { type GetExtendedPodInfo, type GetGatewayInfo, type GetGatewayPods, type GetNodeCollectorInfo, type GetNodeCollectorPods } from '@/types';
|
|
3
|
+
export interface PipelineCollectorsProps {
|
|
4
|
+
tableRowsMaxHeight: CSSProperties['maxHeight'];
|
|
5
|
+
getGatewayInfo: GetGatewayInfo;
|
|
6
|
+
getGatewayPods: GetGatewayPods;
|
|
7
|
+
getNodeCollectorInfo: GetNodeCollectorInfo;
|
|
8
|
+
getNodeCollectorPods: GetNodeCollectorPods;
|
|
9
|
+
getExtendedPodInfo: GetExtendedPodInfo;
|
|
10
|
+
}
|
|
11
|
+
export declare const PipelineCollectors: FC<PipelineCollectorsProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FC, type CSSProperties } from 'react';
|
|
2
|
+
import type { GetExtendedPodInfo, PodInfo } from '@/types';
|
|
3
|
+
export interface PodsInfoProps {
|
|
4
|
+
isLoading?: boolean;
|
|
5
|
+
tableRowsMaxHeight: CSSProperties['maxHeight'];
|
|
6
|
+
pods: PodInfo[];
|
|
7
|
+
getExtendedPodInfo: GetExtendedPodInfo;
|
|
8
|
+
}
|
|
9
|
+
export declare const PodsInfo: FC<PodsInfoProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
import { type GetExtendedPodInfo, type PodInfo } from '@/types';
|
|
3
|
+
import { DrawerProps } from '@/components/_v2';
|
|
4
|
+
export interface PodDrawerProps {
|
|
5
|
+
pod: PodInfo | null;
|
|
6
|
+
getExtendedPodInfo: GetExtendedPodInfo;
|
|
7
|
+
onClose: DrawerProps['header']['onClose'];
|
|
8
|
+
}
|
|
9
|
+
export declare const PodDrawer: FC<PodDrawerProps>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type Dispatch, type SetStateAction, type FC } from 'react';
|
|
2
|
+
export declare enum Tabs {
|
|
3
|
+
Gateway = "gateway",
|
|
4
|
+
Node = "node"
|
|
5
|
+
}
|
|
6
|
+
export interface ToolbarProps {
|
|
7
|
+
isLoading?: boolean;
|
|
8
|
+
selectedTab: Tabs;
|
|
9
|
+
setSelectedTab: Dispatch<SetStateAction<Tabs>>;
|
|
10
|
+
onClickDownloadDiagnose?: () => void;
|
|
11
|
+
onClickRefresh?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare const TABS: {
|
|
14
|
+
value: Tabs;
|
|
15
|
+
label: string;
|
|
16
|
+
}[];
|
|
17
|
+
export declare const Toolbar: FC<ToolbarProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import e,{useState as a,useEffect as l,useMemo as t,useCallback as s}from"react";import{T as i,u as o,a as n,g as r,b as d,D as c,C as u,F as g,S as b,c as m,d as p,e as y,I as k,f as w,B as f,h as C,i as v,j as L,k as h,l as x,m as R,n as P,o as I,p as $,q as D,O as M,W as N,P as S}from"../chunks/ui-components-c940a3cc.js";import A from"styled-components";import{PodIcon as T,ArrowIcon as V,YamlIcon as j,VIcon as z,CopyIcon as U,GatewayIcon as E,PipelineCollectorIcon as H,DownloadIcon as q,RefreshIcon as G}from"../icons.js";import"zustand";import"javascript-time-ago";import"../chunks/vendor-55cc654c.js";import"react-dom";import"@xyflow/react";import"prism-react-renderer";import"react-error-boundary";import"lottie-react";const O=A.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
align-items: center;
|
|
4
|
+
justify-content: space-between;
|
|
5
|
+
width: calc(100% - 24px);
|
|
6
|
+
padding: 8px 12px;
|
|
7
|
+
border-radius: 12px;
|
|
8
|
+
background-color: ${({theme:e})=>e.v2.colors.silver[800]};
|
|
9
|
+
`,F=A.div`
|
|
10
|
+
animation-name: ${i.animations.fade.in};
|
|
11
|
+
`,B=({pod:s,getExtendedPodInfo:i,onClose:L})=>{const{formatTimeAgo:h}=o(),{clickCopy:x,isCopied:R}=n(),[P,I]=a(null),[$,D]=a(!1);l(()=>{s?i(s.namespace,s.name).then(I):(I(null),D(!1))},[s]);const M=t(()=>[{id:r(),title:"Node",label:P?.node??"-"},{id:r(),title:"Role",label:P?.role??"-"},{id:r(),title:"Status",badge:{status:d(P?.status),label:P?.status??"-"}}],[P]),N=t(()=>P?.containers?.map(e=>({id:r(),items:[{id:r(),title:"Container",label:e.name??"-"},{id:r(),title:"Status",badge:{status:d(e.status),label:e.status??"-"},label:e.startedAt?`(since ${h(e.startedAt)})`:""},{id:r(),title:"Image Version",label:e.image?.split(":")?.[1]??"-"},{id:r(),title:"Image Repository",label:e.image?.split(":")?.[0]??"-"},{id:r(),title:"Restarts",label:e.restarts.toString()},{id:r(),title:"State Reason",label:e.stateReason??"-"},{id:r(),title:"Resource Requests",label:`CPU ${e.resources.requests.cpu} • Memory ${e.resources.requests.memory}`},{id:r(),title:"Resource Limits",label:`CPU ${e.resources.limits.cpu} • Memory ${e.resources.limits.memory}`}]}))||[],[P]);return e.createElement(c,{isOpen:!!s,header:{icon:T,title:"Pod Information",onClose:L}},P?null:e.createElement(u,null,e.createElement(g,null)),P?e.createElement(e.Fragment,null,e.createElement(b,{icon:T,title:P.name},e.createElement(m,{$gap:24},e.createElement(p,{cellsPerRow:3,items:M}),N.length>0&&e.createElement(m,{$gap:12},e.createElement(O,null,e.createElement(y,null,"Containers Overview"),e.createElement(k,{icon:()=>e.createElement(V,{rotate:$?0:180}),onClick:()=>D(e=>!e)})),$&&N.map(({id:a,items:l})=>e.createElement(F,{key:a},e.createElement(p,{cellsPerRow:2,items:l})))))),e.createElement(b,{icon:j,title:"YAML",actions:[{id:r(),type:w.Button,props:{label:"",leftIcon:R?z:U,onClick:()=>x(P.manifestYAML),disabled:R,size:f.S,variant:C.Secondary}}]},e.createElement("div",{style:{padding:"0 12px"}},e.createElement(v,{code:P.manifestYAML,language:"yaml",theme:"duotoneDark"})))):null)};var W;!function(e){e.PodName="podName",e.Ready="ready",e.Status="status",e.Restarts="restarts",e.NodeName="nodeName",e.Age="age",e.DockerImage="dockerImage"}(W||(W={}));const Y=[{key:W.PodName,label:"Pod Name",sortable:!0},{key:W.Ready,label:"Ready",sortable:!0,textAlign:"right"},{key:W.Status,label:"Status",sortable:!0},{key:W.Restarts,label:"Restarts",sortable:!0,textAlign:"right"},{key:W.NodeName,label:"Node Name",sortable:!0},{key:W.Age,label:"Age",sortable:!0,textAlign:"right"},{key:W.DockerImage,label:"Docker Image",sortable:!0,textAlign:"right"}],J=({isLoading:l,tableRowsMaxHeight:s,pods:i,getExtendedPodInfo:n})=>{const{formatTimeAgo:r}=o(),[d,c]=a(null),u=t(()=>i.map(e=>({onClick:()=>c(e),cells:[{key:W.PodName,rawValue:e.name},{key:W.Ready,rawValue:e.ready},{key:W.Status,rawValue:e.status??"-"},{key:W.Restarts,rawValue:e.restartsCount},{key:W.NodeName,rawValue:e.nodeName},{key:W.Age,rawValue:r(e.creationTimestamp)},{key:W.DockerImage,rawValue:e.image}]})),[i]);return e.createElement(b,{icon:E,title:"Pods"},e.createElement(L,{maxHeight:s,isLoading:l,columns:Y,rows:u}),e.createElement(B,{pod:d,getExtendedPodInfo:n,onClose:()=>c(null)}))};var K;!function(e){e.Gateway="gateway",e.Node="node"}(K||(K={}));const Q=[{value:K.Gateway,label:"Gateway"},{value:K.Node,label:"Node Collector"}],X=A.div`
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
`,Z=({selectedTab:a,setSelectedTab:l,onClickDownloadDiagnose:t,onClickRefresh:s,isLoading:i})=>e.createElement(X,null,e.createElement(h,{$gap:12},e.createElement(h,{$gap:8},e.createElement(H,{size:32}),e.createElement(y,{size:x.M,weight:500},"Pipeline Collectors")),e.createElement(R,{options:Q,selected:a,setSelected:l})),e.createElement(h,{$gap:8},t&&e.createElement(P,{label:"Download Diagnose",leftIcon:q,size:f.S,variant:C.Text,onClick:t}),s&&e.createElement(P,{label:"Refresh",leftIcon:G,size:f.S,variant:C.Text,onClick:s,loading:i}))),_=({icon:a,title:l,badge:t,statusCard:s,textCards:i})=>e.createElement(b,{icon:a,title:l,badge:t},e.createElement(h,{$gap:16},e.createElement(I,{...s}),i.map(a=>e.createElement($,{key:a.title,...a})))),ee=e=>{switch(e){case N.Healthy:case N.Updating:return"All replicas are running and up to date";case N.Degraded:return"Some replicas unavailable";case N.Failed:return"Rollout failed exceeded progress deadline";case N.Down:return"No available replicas";case N.Unknown:default:return"Status unknown"}},ae=({tableRowsMaxHeight:i,getGatewayInfo:n,getGatewayPods:r,getNodeCollectorInfo:c,getNodeCollectorPods:u,getExtendedPodInfo:g})=>{const{formatTimeAgo:b}=o(),[m,p]=a(!1),[y,k]=a(K.Gateway),[w,f]=a(null),[C,v]=a([]),[L,h]=a(null),[x,R]=a([]),P=s(async()=>{switch(p(!0),y){case K.Gateway:f(await n()),v(await r());break;case K.Node:h(await c()),R(await u())}p(!1)},[y]);l(()=>{P().catch(e=>{})},[P]);const I=t(()=>(e=>{const a=Q.find(a=>a.value===e);return a?.label??"Pipeline Collectors"})(y),[y]),$=t(()=>((e,a,l,t)=>{const s={status:M.Disabled,label:"No rollouts yet"};let i=!1,o=null;switch(e){case K.Gateway:i=a?.rolloutInProgress??!1,o=a?.lastRolloutAt??null;break;case K.Node:i=l?.rolloutInProgress??!1,o=l?.lastRolloutAt??null;break;default:return s}return i?{status:D.Info,label:"Rollout in progress",rightIcon:G,useSecondaryTone:!0}:o?{status:M.Disabled,label:`Last Rollout: ${t(o)}`}:s})(y,w,L,b),[w,L,y,b]),A=t(()=>((e,a,l,t)=>{if(t)return{status:D.Info,title:"Loading",description:"Fetching data..."};let s=M.Unknown,i=N.Unknown,o=ee(N.Unknown);switch(e){case K.Gateway:s=d(a?.status),i=a?.status??i,o=a?.status?ee(a.status):o;break;case K.Node:s=d(a?.status),i=l?.status??i,o=l?.status?ee(l.status):o}return{status:s,title:i,description:o}})(y,w,L,m),[w,L,y,m]),T=t(()=>((e,a,l,t)=>{switch(e){case K.Gateway:return[{title:"HPA Spec (Replicas)",cells:[{label:"Min.",value:a?.hpa.min.toString()??"-",isLoading:t},{label:"Max.",value:a?.hpa.max.toString()??"-",isLoading:t},{label:"Current",value:a?.hpa.current.toString()??"-",isLoading:t},{label:"Desired",value:a?.hpa.desired.toString()??"-",isLoading:t}]},{title:"Requests",cells:[{label:"CPU",value:a?.resources.requests.cpu??"-",isLoading:t},{label:"Memory",value:a?.resources.requests.memory??"-",isLoading:t}]},{title:"Limits",cells:[{label:"CPU",value:a?.resources.limits.cpu??"-",isLoading:t},{label:"Memory",value:a?.resources.limits.memory??"-",isLoading:t}]},{title:"Docker Image",cells:[{value:a?.imageVersion??"-",isLoading:t}]}];case K.Node:return[{title:"Nodes",cells:[{label:"Desired",value:l?.nodes.desired.toString()??"-",isLoading:t},{label:"Ready",value:l?.nodes.ready.toString()??"-",isLoading:t}]},{title:"Requests",cells:[{label:"CPU",value:l?.resources.requests.cpu??"-",isLoading:t},{label:"Memory",value:l?.resources.requests.memory??"-",isLoading:t}]},{title:"Limits",cells:[{label:"CPU",value:l?.resources.limits.cpu??"-",isLoading:t},{label:"Memory",value:l?.resources.limits.memory??"-",isLoading:t}]},{title:"Docker Image",cells:[{value:l?.imageVersion??"-",isLoading:t}]}];default:return[]}})(y,w,L,m),[w,L,y,m]);return e.createElement(S,null,e.createElement(Z,{isLoading:m,selectedTab:y,setSelectedTab:k,onClickDownloadDiagnose:void 0,onClickRefresh:P}),e.createElement(_,{icon:E,title:I,badge:$,statusCard:A,textCards:T}),e.createElement(J,{isLoading:m,tableRowsMaxHeight:i,pods:y===K.Gateway?C:x,getExtendedPodInfo:g}))};export{ae as PipelineCollectors};
|