@odigos/ui-kit 0.0.230 → 0.0.231

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.
Files changed (34) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/lib/chunks/index-DAOWyONO.js +145 -0
  3. package/lib/chunks/{index-DJZLguZq.js → index-tFZXUKvO.js} +1 -1
  4. package/lib/chunks/{ui-components-B4xHrszQ.js → ui-components-CvK0mvVN.js} +378 -378
  5. package/lib/components/_v2/table/index.d.ts +8 -1
  6. package/lib/components/v2.js +1 -1
  7. package/lib/components.js +1 -1
  8. package/lib/constants/sampling/index.d.ts +7 -0
  9. package/lib/constants.js +1 -1
  10. package/lib/containers/_v2/_drawers/add-destination-drawer/form-column/index.d.ts +1 -1
  11. package/lib/containers/_v2/_drawers/add-destination-drawer/lists-column/index.d.ts +1 -1
  12. package/lib/containers/_v2/_drawers/add-source-drawer/namespaces-column/index.d.ts +1 -1
  13. package/lib/containers/_v2/_drawers/add-source-drawer/workloads-column/index.d.ts +1 -1
  14. package/lib/containers/source-drawer/profiling/flame-graph-canvas.d.ts +12 -0
  15. package/lib/containers/source-drawer/profiling/flamebearer.d.ts +21 -2
  16. package/lib/containers/source-drawer/profiling/index.d.ts +1 -9
  17. package/lib/containers/source-drawer/profiling/symbol-table.d.ts +13 -0
  18. package/lib/containers/v2.js +46 -42
  19. package/lib/containers.js +42 -44
  20. package/lib/contexts/sampling-rules-form-context.d.ts +3 -1
  21. package/lib/contexts.js +1 -1
  22. package/lib/functions.js +1 -1
  23. package/lib/hooks.js +1 -1
  24. package/lib/snippets/_v2/sampling-rule-form-sections/index.d.ts +1 -0
  25. package/lib/snippets/_v2/sampling-rule-form-sections/rule-type.d.ts +8 -0
  26. package/lib/snippets/_v2/sampling-rule-form-sections/sampling-preview.d.ts +3 -1
  27. package/lib/snippets/v2.js +1 -1
  28. package/lib/snippets.js +1 -1
  29. package/lib/store.js +1 -1
  30. package/lib/theme.js +1 -1
  31. package/lib/types.js +1 -1
  32. package/lib/visuals.js +1 -1
  33. package/package.json +1 -1
  34. package/lib/chunks/index-CGrd7Nq0.js +0 -149
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.0.231](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.230...ui-kit-v0.0.231) (2026-05-06)
4
+
5
+
6
+ ### Features
7
+
8
+ * **autocomplete, drop-data:** enhance empty state messaging and button visibility ([#855](https://github.com/odigos-io/ui-kit/issues/855)) ([37bea76](https://github.com/odigos-io/ui-kit/commit/37bea760b05fcbe50541ee8721a8b27d06b9252b))
9
+ * improve button ux for add-destination ([#852](https://github.com/odigos-io/ui-kit/issues/852)) ([c37e407](https://github.com/odigos-io/ui-kit/commit/c37e40746d34644bb32797d07b1ed8ae4db0aa65))
10
+ * **profiling:** enhance table and flame graph integration ([#858](https://github.com/odigos-io/ui-kit/issues/858)) ([d68d63e](https://github.com/odigos-io/ui-kit/commit/d68d63ea1e0f77a954d69238951edc58396aef1a))
11
+ * refactor/rename column functions to use hooks in add-destination and add-source drawers ([#854](https://github.com/odigos-io/ui-kit/issues/854)) ([08cfbf0](https://github.com/odigos-io/ui-kit/commit/08cfbf085fdee5051bcd5e454f4af33628b32ebf))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * exclude StaticPod sources from rollout restart action ([#857](https://github.com/odigos-io/ui-kit/issues/857)) ([825a36d](https://github.com/odigos-io/ui-kit/commit/825a36dfe4b3bbde9f1257e6fdd2adb66b29d7c3))
17
+
3
18
  ## [0.0.230](https://github.com/odigos-io/ui-kit/compare/ui-kit-v0.0.229...ui-kit-v0.0.230) (2026-05-04)
4
19
 
5
20
  ### Bug Fixes
@@ -0,0 +1,145 @@
1
+ import{c5 as e,p as a,T as t,k as l,e9 as r,e as s,ah as o,w as i,j as n,ao as d,l as c,I as p,h as u,ar as h,av as g,n as m,F as v,d as f,S as b,a9 as y,aa as x,ea as S,eb as w,aw as C,ec as k,s as T,ed as $,t as L,ee as A,ef as P,eg as M,eh as O,ei as N,ej as z,ek as D,el as X,em as R,en as I,eo as E,ep as H,eq as V,bf as K,a as j,B as U,er as q,es as G,et as J,eu as B,ev as W,ew as F,ex as Z,ey as Q,ez as Y,eA as _,a3 as ee,eB as ae,eC as te,ab as le,eD as re,eE as se,eF as oe,eG as ie,eH as ne,b1 as de,eI as ce,eJ as pe,eK as ue,eL as he,eM as ge,eN as me,eO as ve,eP as fe,eQ as be,bC as ye,o as xe,eR as Se,eS as we,eT as Ce,eU as ke,eV as Te,eW as $e,eX as Le,eY as Ae,eZ as Pe,e_ as Me,z as Oe,e$ as Ne,E as ze,f0 as De,f1 as Xe,f2 as Re,f3 as Ie,f4 as Ee,dP as He,_ as Ve,an as Ke,dm as je,f as Ue,f5 as qe,d7 as Ge,b as Je,N as Be,aH as We,ak as Fe,bs as Ze,dQ as Qe}from"./ui-components-CvK0mvVN.js";import{jsx as Ye,jsxs as _e,Fragment as ea}from"react/jsx-runtime";import{OdigosLogoTextEnterprise as aa,OdigosLogoTextCommunity as ta,EditIcon as la,ArrowLeftIcon as ra,ArrowRightIcon as sa,VSquareIcon as oa}from"../icons.js";import{useCallback as ia,useMemo as na,useState as da,useRef as ca,useEffect as pa,forwardRef as ua,useImperativeHandle as ha}from"react";import ga,{useTheme as ma}from"styled-components";import"./index-tFZXUKvO.js";const va=({isOpen:a,onClose:t,onDeny:l,onApprove:r})=>Ye(e,{title:"Discard changes?",description:"You have unsaved changes.\nIf you cancel now, your changes won't be saved.",isOpen:a,onClose:t,onDeny:l,denyLabel:"Keep editing",onApprove:r,approveLabel:"Discard changes"}),fa=({isOpen:a,onClose:t,onDeny:l,onApprove:r,action:s="delete",target:o})=>{const i=s.charAt(0).toUpperCase()+s.substring(1),n=o?.endsWith("s")?"these":"this";return Ye(e,{title:`${i}${o?` ${o}`:""}?`,description:`Are you sure you want to ${s}${o?` ${n} ${o}`:""}?`,isOpen:a,onClose:t,onDeny:l,denyLabel:"Go back",onApprove:r,approveLabel:i})},ba=({componentType:e,inputType:h,name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S,setValue:w,errorMessage:C,warnMessage:k,helpMessage:T,dropdownOptions:$,dropdownNoSearch:L,dropdownNoCheckbox:A,timeUnits:P,timeDefaultUnit:M})=>{switch(e){case a.Input:return Ye(p,{name:g,type:h,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",onChange:e=>{const a=e.target.value;w(h===u.Number?""===a?null:Number(a):a)},errorMessage:C,warnMessage:k,helpMessage:T},g);case a.MultiInput:return Ye(c,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.KeyValuePair:return Ye(n,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,limitFieldsPerRow:2,columns:[{keyName:"key",label:"Key"},{keyName:"value",label:"Value"}],values:Array.isArray(S)?S:d(S,[]),setValues:e=>w(e),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.TextArea:return Ye(i,{name:g,label:m,tooltip:v,badge:f,required:y,disabled:x,placeholder:b,value:S??"",onChange:e=>w(e.target.value),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Dropdown:return Ye(o,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,withSearch:!L,options:$?.map(e=>({id:e.id||"",label:e.value||"",withCheckbox:!A}))||[],values:S?[String(S)]:[],setValues:e=>w(e[0]),errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Checkbox:return Ye(s,{name:g,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Time:return Ye(r,{name:g,label:m,tooltip:v,badge:f,placeholder:b,required:y,disabled:x,value:S??"",setValue:e=>w(e),units:P,defaultUnit:M,errorMessage:C,warnMessage:k,helpMessage:T},g);case a.Toggle:return Ye(t,{name:g,labelAlign:l.Right,label:m,tooltip:v,badge:f,value:!0===S||"true"===S,onChange:e=>w(e),disabled:x,errorMessage:C,warnMessage:k,helpMessage:T},g);default:return null}},ya=({size:e=200})=>{const{tier:a}=h();return a===g.Onprem?Ye(aa,{size:e}):Ye(ta,{size:e})},xa=[{value:"50",label:"50%"},{value:"25",label:"25%"},{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"custom",label:"Custom"}],Sa=[{value:"10",label:"10%"},{value:"1",label:"1%"},{value:"0.5",label:"0.5%"},{value:"0.1",label:"0.1%"},{value:"custom",label:"Custom"}],wa=[{value:"5000",label:"5s"},{value:"1000",label:"1s"},{value:"500",label:"500ms"},{value:"100",label:"100ms"},{value:"50",label:"50ms"},{value:"custom",label:"Custom"}],Ca=({description:e,options:a,selected:t,onSelect:l,customName:r,customLabel:s,customPlaceholder:o,customValue:i,onCustomChange:n})=>_e(m,{$gap:16,$alignItems:"flex-end",children:[_e(v,{$gap:6,children:[Ye(f,{label:e}),Ye(b,{size:y.S,options:a,selected:t,setSelected:l})]}),"custom"===t&&Ye(p,{name:r,label:s,placeholder:o,type:u.Number,value:i,onChange:n,width:160})]}),ka=()=>{},Ta=e=>e.readOnly?Ye($a,{rule:e.rule}):Ye(La,{ruleType:e.ruleType,formState:e.formState,onChange:e.onChange}),$a=({rule:e})=>{const a=ma(),r=null!=e.durationAtLeastMs;return e.error?Ye(x,{richTitle:{title:S},children:Ye(t,{name:"sampling-view-toggle-keep-errors",onChange:ka,value:!0,size:C.S,label:w,labelAlign:l.Right})}):r?Ye(x,{richTitle:{title:k},children:_e("div",{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:$}),Ye(T,{size:L.XS,children:`${e.durationAtLeastMs}ms`})]})}):null},La=({ruleType:e,formState:a,onChange:r})=>{const s=ia(e=>r({durationPreset:e}),[r]),o=ia(e=>r({customDurationMs:e.target.value}),[r]);return"Error"===e?Ye(x,{richTitle:{title:S,subTitle:A},children:Ye(t,{name:"sampling-toggle-keep-errors",value:!0,onChange:ka,size:C.S,label:w,labelAlign:l.Right})}):"Duration"===e?Ye(x,{richTitle:{title:k,subTitle:P},children:Ye(Ca,{description:$,options:wa,selected:a.durationPreset,onSelect:s,customName:"sampling-input-custom-duration",customLabel:M,customPlaceholder:"200ms",customValue:a.customDurationMs,onCustomChange:o})}):null},Aa=ga.div`
2
+ display: flex;
3
+ gap: 32px;
4
+ `,Pa=ga.div`
5
+ display: flex;
6
+ flex-direction: column;
7
+ gap: 4px;
8
+ `,Ma=ga.div`
9
+ display: flex;
10
+ flex-wrap: wrap;
11
+ align-items: flex-end;
12
+ gap: 16px;
13
+ `,Oa=ga.div`
14
+ display: flex;
15
+ align-items: flex-end;
16
+ gap: 16px;
17
+ padding: 12px 16px;
18
+ border-radius: 8px;
19
+ background-color: ${({theme:e})=>e.v2.colors.black[500]};
20
+ `,Na=ga.div`
21
+ display: flex;
22
+ align-items: flex-end;
23
+ gap: 10px;
24
+ flex: 1;
25
+ `,za=ga.div`
26
+ display: flex;
27
+ align-items: center;
28
+ height: 32px;
29
+ `,Da=ga.div`
30
+ display: flex;
31
+ align-items: flex-end;
32
+ gap: 16px;
33
+ margin-bottom: 12px;
34
+ `,Xa="Any",Ra="Kafka topic",Ia=()=>Ye("div",{style:{marginBottom:"8px"},children:Ye(T,{size:L.XS,weight:500,children:"And"})}),Ea=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"httpClient",label:"HTTP Client"}],Ha=[{value:"all",label:"All Operations"},{value:"httpServer",label:"HTTP Server"},{value:"kafkaConsumer",label:"Kafka Consumer"},{value:"kafkaProducer",label:"Kafka Producer"}],Va=[{id:"",label:Xa},{id:"GET",label:"GET"},{id:"POST",label:"POST"},{id:"PUT",label:"PUT"},{id:"DELETE",label:"DELETE"},{id:"PATCH",label:"PATCH"}];const Ka=e=>e.readOnly?Ye(ja,{data:e.data}):Ye(Ua,{category:e.category,formState:e.formState,onChange:e.onChange}),ja=({data:e})=>{const a=ma(),t=na(()=>function(e){if("noisy"===e.category){const a=e.rule.operation;if(a?.httpServer)return[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||W},{id:"method",title:q,value:a.httpServer.method||Xa}];if(a?.httpClient){const e=[{id:"type",title:B,value:F}];return a.httpClient.serverAddress&&e.push({id:"serverAddress",title:"Server address",value:a.httpClient.serverAddress}),e.push({id:"route",title:E,value:a.httpClient.templatedPath||a.httpClient.templatedPathPrefix||W}),e.push({id:"method",title:q,value:a.httpClient.method||Xa}),e}return[{id:"type",title:B,value:Z}]}const a=e.rule.operation;return a?.httpServer?[{id:"type",title:B,value:J},{id:"route",title:E,value:a.httpServer.route||a.httpServer.routePrefix||W},{id:"method",title:q,value:a.httpServer.method||Xa}]:a?.kafkaConsumer?[{id:"type",title:B,value:Q},{id:"topic",title:Ra,value:a.kafkaConsumer.kafkaTopic||W}]:a?.kafkaProducer?[{id:"type",title:B,value:Y},{id:"topic",title:Ra,value:a.kafkaProducer.kafkaTopic||W}]:[{id:"type",title:B,value:Z}]}(e),[e]);return Ye(x,{richTitle:{title:O},children:Ye(Aa,{children:t.map(({id:e,title:t,value:l})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:t}),Ye(T,{size:L.XS,nowrap:!0,children:l})]},e))})})},Ua=({category:e,formState:a,onChange:t})=>{const l=na(()=>"noisy"===e?Ea:Ha,[e]),r=ia(e=>t({operationType:e,route:"",serverAddress:"",method:"",kafkaTopic:""}),[t]),s=ia(e=>a=>{a&&t({routeType:e,route:""})},[t]),o=ia(e=>t({route:e.target.value}),[t]),i=ia(e=>t({serverAddress:e.target.value}),[t]),n=ia(e=>t({method:e[0]||""}),[t]),d=ia(e=>t({kafkaTopic:e.target.value}),[t]),c="httpServer"===a.operationType||"httpClient"===a.operationType,u="kafkaConsumer"===a.operationType||"kafkaProducer"===a.operationType,h="httpClient"===a.operationType?I:E,g="httpClient"===a.operationType?H:V;return _e(x,{richTitle:{title:`2. ${O}`,subTitle:N},children:[Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:l,selected:a.operationType,setSelected:r})}),c&&_e(Ma,{children:["httpClient"===a.operationType&&_e(Da,{children:[Ye(p,{name:"sampling-input-server-address",label:D,placeholder:z,value:a.serverAddress,onChange:i}),Ye(Ia,{})]}),_e(Oa,{children:[_e(Na,{children:[Ye(za,{children:Ye(X,{"data-id":"sampling-radio-route",value:"route"===a.routeType,onChange:s("route")})}),Ye(p,{name:"sampling-input-route",label:h,placeholder:R,value:"route"===a.routeType?a.route:"",onChange:o,disabled:"route"!==a.routeType})]}),_e(Na,{children:[Ye(za,{children:Ye(X,{"data-id":"sampling-radio-route-prefix",value:"routePrefix"===a.routeType,onChange:s("routePrefix")})}),Ye(p,{name:"sampling-input-route-prefix",label:g,placeholder:R,value:"routePrefix"===a.routeType?a.route:"",onChange:o,disabled:"routePrefix"!==a.routeType})]})]}),_e(Da,{children:[Ye(Ia,{}),Ye(K,{label:q,items:Va,selectedIds:[a.method||""],setSelectedIds:e=>n(e),buttonProps:{"data-id":"sampling-btn-method",label:Va.find(e=>e.id===a.method)?.label||Xa,size:U.S,variant:j.Secondary}})]})]}),u&&Ye(p,{name:"sampling-input-kafka-topic",label:G,placeholder:"Type kafka topic",value:a.kafkaTopic,onChange:d,width:"320px"})]})},qa=[{value:"all",label:"Drop All"},{value:"sample",label:"Sample"}],Ga=[{value:"all",label:"Keep All"},{value:"sample",label:"Sample"}];const Ja=e=>e.readOnly?Ye(Ba,{data:e.data}):Ye(Wa,{category:e.category,formState:e.formState,onChange:e.onChange}),Ba=({data:e})=>{const a=ma(),t=na(()=>function(e){switch(e.category){case"highlyRelevant":return null!=e.rule.percentageAtLeast?{title:ae,method:oe,description:re,value:`${e.rule.percentageAtLeast}%`}:{title:ae,method:ne,description:null,value:null};case"noisy":return null!=e.rule.percentageAtMost?{title:te,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}:{title:te,method:ie,description:null,value:null};case"costReduction":return{title:te,method:oe,description:se,value:`${e.rule.percentageAtMost}%`}}}(e),[e]),l=[{id:"method",title:q,value:t.method},...null!=t.description?[{id:"value",title:t.description,value:t.value}]:[]];return Ye(x,{richTitle:{title:t.title},children:Ye(Aa,{children:l.map(({id:e,title:t,value:l})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:t}),Ye(T,{size:L.XS,nowrap:!0,children:l})]},e))})})},Wa=({category:e,formState:a,onChange:t})=>{const l="highlyRelevant"===e,r=l?Ga:qa,s=`${l?4:3}. ${l?ae:te}`,o=l?_:ee,i=l?re:se,n="noisy"===e?Sa:xa,d=ia(e=>t({percentageMode:e}),[t]),c=ia(e=>t({percentagePreset:e}),[t]),p=ia(e=>t({customPercentage:e.target.value}),[t]);return _e(x,{richTitle:{title:s,subTitle:o},children:["costReduction"!==e&&Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:r,selected:a.percentageMode,setSelected:d})}),("costReduction"===e||"sample"===a.percentageMode)&&Ye(Ca,{description:i,options:n,selected:a.percentagePreset,onSelect:c,customName:"sampling-input-custom-percentage",customLabel:le,customPlaceholder:"5%",customValue:a.customPercentage,onCustomChange:p})]})},Fa=ga.div`
35
+ display: flex;
36
+ align-items: flex-end;
37
+ gap: 16px;
38
+ `,Za=ga.div`
39
+ width: 280px;
40
+ flex-shrink: 0;
41
+ `,Qa=ga.div`
42
+ flex: 1;
43
+ min-width: 0;
44
+ `;function Ya(e){return"highlyRelevant"===e.category?e.rule.error?"Error":null!=e.rule.durationAtLeastMs?"Duration":"Relevance":ve[e.category]}const _a=e=>e.readOnly?Ye(et,{data:e.data}):Ye(at,{formState:e.formState,onChange:e.onChange}),et=({data:e})=>{const a=ma(),t=na(()=>[{id:"name",title:ce,value:e.rule.name||de},{id:"type",title:pe,value:Ya(e)}],[e]),l=e.rule.notes||W;return _e(x,{children:[Ye(Aa,{children:t.map(({id:e,title:t,value:l})=>_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],nowrap:!0,children:t}),Ye(T,{size:L.XS,nowrap:!0,children:l})]},e))}),_e(Pa,{children:[Ye(T,{size:L.XXXS,color:a.v2.colors.silver[200],children:ue}),Ye(T,{size:L.XS,children:l})]})]})},at=({formState:e,onChange:a})=>{const t=ia(e=>a({name:e.target.value}),[a]),l=ia(e=>a({notes:e.target.value}),[a]);return Ye(x,{children:_e(Fa,{children:[Ye(Za,{children:Ye(p,{name:"sampling-input-rule-name",label:ce,tooltip:"Optional. Give this rule a name for easier identification.",placeholder:he,value:e.name,onChange:t})}),Ye(Qa,{children:Ye(p,{name:"sampling-input-note",label:ue,tooltip:me,placeholder:ge,value:e.notes,onChange:l})})]})})},tt=[{value:"Relevance",label:"Relevance"},{value:"Error",label:"Error"},{value:"Duration",label:"Duration"}],lt=({formState:e,onChange:a})=>{const t=ia(e=>a({ruleType:e,keepErrors:"Error"===e}),[a]);return Ye(x,{richTitle:{title:`3. ${pe}`,subTitle:fe},children:Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:tt,selected:e.ruleType,setSelected:t})})})},rt=ga.div`
45
+ display: flex;
46
+ align-items: center;
47
+ gap: 24px;
48
+ padding: 8px 16px;
49
+ border-radius: 12px;
50
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
51
+ `,st=ga.div`
52
+ flex: 1;
53
+ min-width: 0;
54
+ white-space: pre;
55
+ overflow-x: auto;
56
+ `,ot=({title:e,summary:a,onEdit:t,renderAction:l})=>{const r=na(()=>{const t=[];return e&&(t.push({text:e,variant:be.Default}),t.push({text:" - ",variant:be.Default})),t.push(...a),t},[e,a]);return _e(rt,{children:[Ye(st,{children:Ye(ye,{parts:r})}),l&&l(),t&&Ye(xe,{"data-id":"sampling-btn-edit-auto-rule",label:Se,rightIcon:la,variant:j.Text,size:U.S,onClick:t})]})},it=e=>{const a=na(()=>{if(e.readOnly)return e.summary;switch(e.category){case"noisy":return $e(Le(e.formState));case"highlyRelevant":return ke(Te(e.formState));case"costReduction":return we(Ce(e.formState))}},[e]);if(e.readOnly)return Ye(ot,{title:Ae,summary:a,renderAction:e.renderAction});const t=1===a.length&&"default"===a[0].variant;return Ye(ot,{title:t?Pe:Ae,summary:t?[]:a,renderAction:e.renderAction})},nt=ga.div`
57
+ display: flex;
58
+ flex-wrap: wrap;
59
+ gap: 8px;
60
+ `,dt=ga.div`
61
+ display: flex;
62
+ align-items: center;
63
+ gap: 8px;
64
+ padding: 8px 12px;
65
+ border-radius: 8px;
66
+ cursor: pointer;
67
+ background: ${({theme:e,$selected:a})=>a?e.v2.colors.silver[700]:e.v2.colors.silver[900]};
68
+ border: 1px solid ${({theme:e,$selected:a})=>a?e.v2.colors.silver[500]:e.v2.colors.silver[800]};
69
+
70
+ &:hover {
71
+ background: ${({theme:e})=>e.v2.colors.silver[700]};
72
+ }
73
+ `,ct=ga.div`
74
+ display: flex;
75
+ width: 32px;
76
+ height: 32px;
77
+ justify-content: center;
78
+ align-items: center;
79
+ flex-shrink: 0;
80
+ `,pt=ga.div`
81
+ display: flex;
82
+ flex-direction: column;
83
+ gap: 4px;
84
+ `,ut=ga.div`
85
+ display: flex;
86
+ align-items: center;
87
+ gap: 8px;
88
+ padding: 8px;
89
+ border-radius: 8px;
90
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
91
+ `,ht=ga.div`
92
+ display: flex;
93
+ width: 24px;
94
+ height: 24px;
95
+ justify-content: center;
96
+ align-items: center;
97
+ flex-shrink: 0;
98
+ `,gt={[He.JavaScript]:"Node.js",[He.DotNet]:".NET",[He.Php]:"PHP",[He.Java]:"Java",[He.Go]:"Go",[He.Python]:"Python",[He.Ruby]:"Ruby",[He.Rust]:"Rust"},mt=[He.Python,He.Java,He.JavaScript,He.DotNet,He.Php,He.Ruby,He.Go].map(e=>({id:e,label:gt[e]??e.charAt(0).toUpperCase()+e.slice(1),Icon:Ve(e)})),vt=[{value:"all",label:"Entire Cluster"},{value:"source",label:"Specific Source"},{value:"namespace",label:"Specific Namespace"},{value:"language",label:"Specific Programming Language"}];function ft(e){const a=gt[e];return a||e.charAt(0).toUpperCase()+e.slice(1)}const bt=e=>e.readOnly?Ye(yt,{scopes:e.scopes}):Ye(xt,{formState:e.formState,onChange:e.onChange,sourceOptions:e.sourceOptions,namespaceOptions:e.namespaceOptions}),yt=({scopes:e})=>{const a=ma();return Ye(x,{richTitle:{title:Me},children:e.length?Ye(pt,{children:e.map((e,t)=>((e,t)=>{if(e.workloadLanguage){const l=Ve(e.workloadLanguage);return _e(ut,{children:[l&&Ye(ht,{children:Ye(l,{size:18})}),Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:ft(e.workloadLanguage)})]},t)}const l=[e.workloadNamespace,e.workloadKind,e.workloadName].filter(Boolean),r=l.length?l.join(" / "):"Unknown scope";return Ye(ut,{children:Ye(T,{size:L.XS,color:a.v2.colors.white[500],children:r})},t)})(e,t))}):Ye(Oe,{status:ze.Default,message:Ne,fullWidth:!0})})},xt=({formState:e,onChange:a,sourceOptions:t=[],namespaceOptions:l=[]})=>{const[r,o]=da("all"),i=e.sourceScopes.length>0,n=na(()=>vt.map(e=>({...e,disabled:"all"===e.value&&i})),[i]),d=na(()=>e.sourceScopes.filter(e=>"source"===e.scopeType).map(e=>{return a=e.workloadNamespace,t=e.workloadKind,l=e.workloadName,`${a}/${t}/${l}`;var a,t,l}),[e.sourceScopes]),c=na(()=>e.sourceScopes.filter(e=>"namespace"===e.scopeType).map(e=>e.workloadNamespace),[e.sourceScopes]),p=na(()=>new Set(e.sourceScopes.filter(e=>"language"===e.scopeType).map(e=>e.workloadLanguage)),[e.sourceScopes]),u=ia(e=>{o(e)},[]),h=ia(t=>{const l=e.sourceScopes.filter(e=>"source"!==e.scopeType),r=t.map(e=>function(e){const a=e.split("/");return 3!==a.length?null:{namespace:a[0],kind:a[1],name:a[2]}}(e)).filter(e=>null!==e).map(e=>({scopeType:"source",workloadName:e.name,workloadKind:e.kind,workloadNamespace:e.namespace,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),g=ia(t=>{const l=e.sourceScopes.filter(e=>"namespace"!==e.scopeType),r=t.map(e=>({scopeType:"namespace",workloadName:"",workloadKind:"",workloadNamespace:e,workloadLanguage:""}));a({sourceScopes:[...l,...r]})},[e.sourceScopes,a]),m=ia(t=>{if(e.sourceScopes.some(e=>"language"===e.scopeType&&e.workloadLanguage===t))a({sourceScopes:e.sourceScopes.filter(e=>!("language"===e.scopeType&&e.workloadLanguage===t))});else{const l={scopeType:"language",workloadName:"",workloadKind:"",workloadNamespace:"",workloadLanguage:t};a({sourceScopes:[...e.sourceScopes,l]})}},[e.sourceScopes,a]);return _e(x,{richTitle:{title:`1. ${Me}`,subTitle:De},children:[Ye(Oe,!i&&"all"===r?{status:ze.Default,message:Ne,fullWidth:!0,smallIcon:!0}:{status:ze.Info,message:Xe,fullWidth:!0,smallIcon:!0}),Ye(v,{$alignItems:"flex-start",children:Ye(b,{size:y.S,options:n,selected:r,setSelected:u})}),"source"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-source",options:t,value:d,onSelect:h,placeholder:Ie}),"namespace"===r&&Ye(Re,{multiple:!0,"data-id":"sampling-autocomplete-namespace",options:l,value:c,onSelect:g,placeholder:"Search namespace"}),"language"===r&&Ye(nt,{children:mt.map(({id:e,label:a,Icon:t})=>{const l=p.has(e);return _e(dt,{$selected:l,onClick:()=>m(e),children:[Ye(s,{name:`sampling-scope-lang-${e}`,size:Ee.S,value:l,onChange:()=>m(e)}),Ye(ct,{children:Ye(t,{size:20})}),Ye(T,{size:L.XS,nowrap:!0,children:a})]},e)})})]})},St=(e,a)=>!a?.length||!!a?.find(a=>a===e),wt=({title:e="Signals",required:a,errorMessage:t,allowedSignals:l,selectedSignals:r,setSelectedSignals:o,disabled:i})=>{const[n,d]=da(1===r.length),c=ca(JSON.stringify(r));pa(()=>{const e=Ke(r);e.length||je.forEach(({id:a})=>{St(a,l)&&e.push(a)});const a=JSON.stringify(e);c.current!==a&&(c.current=a,o(e),d(1===e.length))},[l,r]);return _e(v,{$gap:12,children:[Ye(f,{label:e,required:a}),Ye(m,{$gap:12,children:je.map(e=>{const a=St(e.id,l),t=((e,a)=>!!a?.find(a=>a===e))(e.id,r);return a?Ye(s,{label:e.value,disabled:i||!a||n&&t,value:t,onChange:a=>((e,a)=>{const t=e,l=a?[...r,t]:r.filter(e=>e!==t);o(l),d(1===l.length)})(e.id,a)},e.id):null})}),Ye(Ue,{errorMessage:t})]})},Ct=({minSupportedVersion:a,currentVersion:t})=>Ye(e,{isOpen:!0,onClose:()=>{},relativeToParent:!0,visual:()=>Ye(qe,{scale:2.4,icon:()=>Ye("svg",{xmlns:"http://www.w3.org/2000/svg",width:"22",height:"21",viewBox:"0 0 22 21",fill:"none",children:Ye("path",{fill:"#151618",d:"M9.4844 0.730003C9.99694 -0.243259 11.4076 -0.24341 11.92 0.730003L11.9685 0.831353L14.3039 6.22012L20.153 6.77755C21.3553 6.89211 21.841 8.38683 20.9358 9.18621L16.5314 13.0731L17.8091 18.8079C18.0716 19.9868 16.8005 20.9109 15.7605 20.2969L10.7017 17.3093L5.64282 20.2969C4.60289 20.9104 3.33173 19.9866 3.59427 18.8079L4.87192 13.0741L0.468608 9.18621C-0.43662 8.38693 0.0482932 6.8924 1.25029 6.77755L7.09837 6.22012L9.43588 0.831353L9.4844 0.730003ZM8.55284 7.02876C8.35287 7.48992 7.9179 7.80589 7.41751 7.85357L2.03952 8.36571L6.09027 11.941C6.46691 12.2737 6.63296 12.7852 6.5237 13.2758L5.34956 18.5459L10.0008 15.8009L10.1669 15.7179C10.5087 15.574 10.8945 15.5741 11.2364 15.7179L11.4036 15.8009L16.0538 18.5459L14.8807 13.2758C14.7714 12.7851 14.9374 12.2737 15.3141 11.941L19.3627 8.36571L13.9858 7.85357C13.4855 7.80587 13.0505 7.4899 12.8505 7.02876L10.7017 2.07342L8.55284 7.02876Z"})})}),title:"Upgrade Required",description:`To use this feature, please upgrade to Odigos v${a} or later.\nCurrent version: ${t}.`}),kt=ga.div`
99
+ display: flex;
100
+ flex-direction: column;
101
+ justify-content: flex-end;
102
+ width: ${({$width:e})=>e};
103
+ gap: ${({$columnHasHeader:e})=>e?"0":"12px"};
104
+ `,Tt=ga.div`
105
+ display: flex;
106
+ align-items: center;
107
+ min-height: 24px;
108
+ padding: 12px;
109
+ border-radius: 16px 16px 0 0;
110
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
111
+ `,$t=ga.div`
112
+ display: flex;
113
+ flex-direction: column;
114
+ gap: ${({$gap:e})=>e}px;
115
+ padding: 12px 12px 0 12px;
116
+ width: calc(100% - 24px);
117
+ height: ${({$heightOffset:e,$columnHasHeader:a})=>`calc(100vh - 180px - ${e}px ${a?"- 48px":""})`};
118
+ border-radius: ${({$columnHasHeader:e,$isLeft:a,$isRight:t})=>e?a?"0 0 0 16px":t?"0 16px 0 0":"0":a?"16px 0 0 16px":t?"0 16px 16px 0":"16px"};
119
+ background-color: ${({theme:e})=>e.v2.colors.silver[900]};
120
+ overflow-y: auto;
121
+ overflow-x: hidden;
122
+ `,Lt=({isLeft:e,isRight:a,heightOffset:t=0,width:l,header:r,list:s})=>_e(kt,{$width:l,$columnHasHeader:!!r,children:[r&&Ye(Tt,{children:r}),Ye($t,{$gap:8,$isLeft:e,$isRight:a,$heightOffset:t,$columnHasHeader:!!r,children:s.length?s.length>1?Ye(Ge,{gap:8,elements:s}):Ye(ea,{children:s[0]}):Ye(Je,{$height:"100%",children:Ye(Be,{})})})]}),At="75vw",Pt=ga.div`
123
+ display: flex;
124
+ flex-direction: column;
125
+ border-radius: 16px;
126
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
127
+ overflow: hidden;
128
+ `,Mt=ga.div`
129
+ display: flex;
130
+ gap: 12px;
131
+ padding: 16px 16px 0 16px;
132
+ background-color: ${({theme:e})=>e.v2.colors.silver[1e3]};
133
+ position: sticky;
134
+ top: 0;
135
+ `,Ot=ga.div`
136
+ padding: 12px 12px 0 12px;
137
+ `,Nt=ga.div`
138
+ display: flex;
139
+ gap: 12px;
140
+ padding: 16px;
141
+ `,zt=ga.div`
142
+ padding: 5vh 10vw;
143
+ border-radius: 12px;
144
+ background-color: ${({theme:e})=>e.v2.colors.silver[800]};
145
+ `,Dt=ua(({isOpen:a,withOverlay:t,disableAnimation:l,onClose:r,onBack:s,onNext:o,nextIsSkip:i,onSave:n,disableSave:d,connectionIds:c,header:p,subHeader:u,leftColumn:h,rightColumn:g,search:m,filters:v,errorMessage:f,isFormDirty:b,hideDirtyNote:y,isFetching:x,progress:S},w)=>{const[C,k]=da(!1),[T,$]=da(!1),[A,P]=da(void 0);ha(w,()=>({clearErrors:()=>P(void 0)}));const M=T,O=ia(()=>{b&&!C?k(!0):(k(!1),r?.())},[b,C,r]),N=d||T||"boolean"==typeof b&&!b,z=ia(async()=>{$(!0);const e=await n();$(!1),e?.error?P(e.error):(c?.setValue([]),r?.())},[n,c,r]),D=!!m||!!c||!!v,X=!!u,R=(D?48:0)+(X?50:0),I=na(()=>x?{status:ze.Info,message:"Fetching Data..."}:T&&!S?{status:ze.Info,message:"Saving Changes..."}:A||f?{status:ze.Error,message:A||f}:"boolean"==typeof b&&b&&!y?{status:ze.Info,message:'The values don\'t reflect the current configurations of the selected clusters.\n"Save" will override the current configurations.'}:"boolean"!=typeof b||b||y?void 0:{status:ze.Success,message:"The values reflect the current configuration of the selected cluster."},[x,T,S,A,f,b,y]),E=na(()=>s?{label:"Back",leftIcon:ra,variant:j.Secondary,onClick:s}:{label:"Cancel",variant:j.Secondary,onClick:O,disabled:M},[s,O,M]),[H,V]=da(!1),K=na(()=>o?i?{"data-id":"wide-drawer-skip",label:"Skip",rightIcon:sa,variant:j.Secondary,onClick:()=>V(!0)}:{"data-id":"wide-drawer-next",label:"Next",rightIcon:sa,variant:j.Primary,onClick:o}:{"data-id":"wide-drawer-save",label:"Save",variant:j.Primary,onClick:z,disabled:N},[o,i,z,N]);return _e(We,{width:At,isOpen:a,disableAnimation:l,hideOverlay:!T&&!t,header:{...p,onClose:r?O:void 0,onCloseDisabled:M},footer:{note:I,actions:[E,K]},children:[T?Ye(Je,{$height:"calc(100vh - 136px)",children:Ye(zt,{children:Ye(Fe,{titleSize:L.S,subTitleSize:L.XXXS,withGradient:!0,withSpinner:!0,...S})})}):_e(Pt,{children:[D&&_e(Mt,{children:[c&&Ye(Ze,{icon:oa,title:"Selected Clusters",badge:{label:c.value.length}}),m&&Ye(Qe,{width:"100%",...m}),v]}),X&&Ye(Ot,{children:Ye(Ze,{icon:u.icon,title:u.title,subTitle:u.description,badge:u.badge})}),_e(Nt,{children:[Ye(Lt,{isLeft:!0,heightOffset:R,...h}),Ye(Lt,{isRight:!0,heightOffset:R,...g})]})]}),Ye(va,{isOpen:C,onClose:()=>k(!1),onApprove:O}),Ye(e,{title:"Skip setup?",description:"Without completing setup, Odigos won't be able to collect and send your telemetry data. This may interrupt your data flow and limit the platform's ability to provide value.",isOpen:H,onApprove:o,onDeny:()=>V(!1),onClose:()=>V(!1)})]})});Dt.displayName=Dt.name;export{ot as A,va as C,ba as D,Sa as N,Ka as O,Ca as P,_a as R,wt as S,Ct as U,Dt as W,xa as a,it as b,bt as c,lt as d,Ta as e,Ja as f,fa as g,At as h,ya as i,wa as j};
@@ -1,3 +1,3 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-B4xHrszQ.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
1
+ import{jsx as t}from"react/jsx-runtime";import{useMemo as e}from"react";import i from"styled-components";import{u as o,B as s,a,A as n,g as l,D as r,C as c,b as p,N as m}from"./ui-components-CvK0mvVN.js";import{VIcon as d,CopyIcon as u,YamlIcon as f}from"../icons.js";const h=i.div`
2
2
  padding: 0 12px;
3
3
  `,g=({title:i="YAML",yaml:g,defaultOpen:b,fullHeight:T,bgTint:y="1000"})=>{const{clickCopy:C,isCopied:x}=o(),A=e(()=>g?[{id:l(),type:n.Button,buttonProps:{variant:a.Text,size:s.S,leftIcon:x?d:u,onClick:()=>C(g||""),disabled:x}}]:[],[g,x]);return t(r,{bgTint:y,richTitle:{icon:f,title:i},actions:A,withCollapse:!0,collapseIsDefaultOpen:b,fullHeight:T,children:t(h,{children:g?t(c,{code:g,language:"yaml",theme:"duotoneDark"}):t(p,{children:t(m,{title:"YAML not found",subTitle:"The YAML for this resource is not available"})})})})};export{g as Y};