@ufal-lccv/gpsub-ds 0.0.11 → 0.0.13

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 (28) hide show
  1. package/dist/{Checkbox.view-B-GrHFEa.js → Checkbox.view-D75146I3.js} +1033 -982
  2. package/dist/{Checkbox.view-DpYmvx5w.cjs → Checkbox.view-DFbiE7Mi.cjs} +118 -118
  3. package/dist/RequiredLabel.view-Cv_y1fuR.js +130 -0
  4. package/dist/RequiredLabel.view-DRKx7lq3.cjs +1 -0
  5. package/dist/Table.view-BipNpove.cjs +586 -0
  6. package/dist/{Table.view-B9_6CG4G.js → Table.view-CHEV4kuX.js} +826 -711
  7. package/dist/{Title.view-CxaPmd5z.cjs → Title.view-B2dLqH4V.cjs} +1 -1
  8. package/dist/{Title.view-D-L8EJcc.js → Title.view-DGXidSXd.js} +1 -1
  9. package/dist/components/atoms/index.cjs.js +1 -1
  10. package/dist/components/atoms/index.es.js +2 -2
  11. package/dist/components/index.cjs.js +1 -1
  12. package/dist/components/index.es.js +16 -15
  13. package/dist/components/molecules/AlertInline/AlertInline.view.d.ts +4 -1
  14. package/dist/components/molecules/index.cjs.js +1 -1
  15. package/dist/components/molecules/index.es.js +2 -2
  16. package/dist/components/organisms/CollapseSection/CollapseSection.view.d.ts +2 -1
  17. package/dist/components/organisms/TabInfo/TabInfo.style.d.ts +5 -0
  18. package/dist/components/organisms/TabInfo/TabInfo.view.d.ts +19 -0
  19. package/dist/components/organisms/TabInfo/index.d.ts +1 -0
  20. package/dist/components/organisms/index.cjs.js +1 -1
  21. package/dist/components/organisms/index.d.ts +2 -1
  22. package/dist/components/organisms/index.es.js +6 -5
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +25 -24
  25. package/package.json +1 -1
  26. package/dist/RequiredLabel.view-CVWg_TdI.cjs +0 -1
  27. package/dist/RequiredLabel.view-DM5zIUlt.js +0 -98
  28. package/dist/Table.view-BJO6XwCO.cjs +0 -541
@@ -0,0 +1,586 @@
1
+ "use strict";const o=require("./Checkbox.view-DFbiE7Mi.cjs"),u=require("react"),t=require("sbwb-ds"),H=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:a={},wrapperCustomStyles:c={},hideAdornmentOnCollapse:l=!1,maxHeight:x="none"})=>{const[d,m]=u.useState(!1),[p,f]=u.useState(!0);u.useEffect(()=>{if(l)if(d){const h=setTimeout(()=>f(!1),ee);return()=>clearTimeout(h)}else f(!0)},[d,l]);const S=l&&!p?null:i;return o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",flex:"1",gap:"8px",customStyles:c,children:[o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!0,marginBottom:s,collapse:{collapsed:d,setCollapsed:m},endAdornment:S,customStyles:a}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",customStyles:{maxHeight:d?"0":x,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,a,c,l,x;n==null&&(n=100);function d(){var p=Date.now()-l;p<n&&p>=0?s=setTimeout(d,n-p):(s=null,i||(x=e.apply(c,a),c=a=null))}var m=function(){c=this,a=arguments,l=Date.now();var p=i&&!s;return s||(s=setTimeout(d,n)),p&&(x=e.apply(c,a),c=a=null),x};return m.clear=function(){s&&(clearTimeout(s),s=null)},m.flush=function(){s&&(x=e.apply(c,a),c=a=null,clearTimeout(s),s=null)},m}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const a=u.useCallback(()=>{e.trigger(n)},[e,n]),c=u.useMemo(()=>de(()=>a(),s),[a,s]),l=u.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),x=u.useMemo(()=>["all","onBlur"].includes(i)?a:null,[i]);return u.useMemo(()=>({onChangeTrigger:l,onBlurTrigger:x}),[l,x])}const ge=({form:e,name:n,label:i,options:s,readonly:a=!1,disabled:c=!1,optionsMap:l,width:x="100%",flex:d,placeholder:m,onSelect:p,parser:f,filter:S,tooltipProps:h={},infoProps:j={},maxHeigthMenu:R,isRequired:E=!1,onRemoveSelected:F,triggerFormField:b=null,displayText:W,...v})=>{const{onChangeTrigger:C}=Z({form:e,fieldName:n,triggerType:b,debounceTime:0}),O={position:"top",...h},L={...j,tooltipProps:{position:"top",maxWidth:"300px",...j==null?void 0:j.tooltipProps}},T=(w,I)=>{let M=w;f&&(M=f==null?void 0:f(w)),I(M),p==null||p(M),C==null||C()},$=u.useMemo(()=>H.valuable(l)?l:Object.fromEntries(s.map(w=>[w.value,w])),[s,l]);return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:d,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:w,value:I},fieldState:{error:M=null}})=>{let k=$[I];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:a,filter:S,errorMessage:M==null?void 0:M.message,placeholder:m,value:k,handleOption:g=>{T(g.value,w)},tooltipProps:O,options:s,maxHeigthMenu:R,infoProps:L,maxHeightMenu:R,isRequired:E,onRemoveSelected:F,displayText:W,...v})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:a=!1,width:c="100%",height:l="100%",flex:x,placeholder:d,charactersCounter:m=!0,maxlength:p=1e3,resize:f=!0,triggerFormField:S=null,minHeight:h,maxHeight:j,...R})=>{const{onChangeTrigger:E}=Z({form:e,fieldName:n,triggerType:S}),F=(b,W)=>{W(b),E==null||E()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:x,height:l,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:b,value:W},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:W||"",width:"100%",disabled:a,readonly:s,height:l,minHeight:h,maxHeight:j,errorMessage:v==null?void 0:v.message,placeholder:d,onChange:C=>F(C.target.value,b),charactersCounter:m,maxlength:p,size:"Small",resize:f,...R})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:a=!1,disabled:c=!1,afterCheck:l,width:x="100%",formatter:d,parser:m,flex:p,size:f="Medium",triggerFormField:S=null,...h})=>{const{onChangeTrigger:j}=Z({form:e,fieldName:n,triggerType:S,debounceTime:0}),R=(E,F)=>{F(E),l==null||l(E),j==null||j()};return o.jsxRuntimeExports.jsx(o.Container,{width:x,flex:p,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:E,value:F},fieldState:{error:b=null}})=>{const W=b==null?void 0:b.message;return W&&console.log("Error on checkbox!",W),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(d==null?void 0:d(F))??F,name:n,label:s,disabled:c||a,onChange:v=>{R((m==null?void 0:m(v.target.checked,F))??v.target.checked,E)},size:f,...h})}})})},fe=o.qe.ul`
2
+ ${H.resetStyles}
3
+ position: fixed;
4
+ margin-top: ${({marginTop:e})=>e};
5
+ padding: ${t.sg.spacings.spacingStack.spacingStackXs} 4px
6
+ ${t.sg.spacings.spacingStack.spacingStackSm} 0;
7
+ list-style: none;
8
+ display: block;
9
+ overflow-y: auto;
10
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
11
+ box-shadow: ${t.sg.shadows.shadowLevelNear};
12
+ width: ${({width:e})=>e};
13
+ height: fit-content;
14
+ max-height: ${({maxHeight:e})=>(e??"180px")+" !important"};
15
+ z-index: 1000;
16
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
17
+
18
+ ::-webkit-scrollbar {
19
+ width: 6px;
20
+ }
21
+
22
+ ::-webkit-scrollbar-track {
23
+ background: ${t.sg.colors.neutralColors.colorNeutralSoft};
24
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
25
+ }
26
+
27
+ ::-webkit-scrollbar-thumb {
28
+ background: ${t.sg.colors.neutralColors.colorNeutralClean};
29
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
30
+ }
31
+ `,he=o.qe.li`
32
+ ${H.resetStyles}
33
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
34
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
35
+ padding: ${t.sg.spacings.spacingInline.spacingInlineXs};
36
+ margin: 0 ${t.sg.spacings.spacingInline.spacingInlineXs};
37
+ cursor: default;
38
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
39
+ `,xe=o.qe.li`
40
+ ${H.resetStyles}
41
+ display: flex;
42
+ flex: 2;
43
+ flex-direction: ${({menuOptionFlexDirection:e})=>e};
44
+ align-items: ${({menuJustifyContent:e})=>e};
45
+ justify-content: ${({tableActionButton:e})=>e?"flex-start":"center"};
46
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
47
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
48
+
49
+ color: ${({isOptionSelected:e,disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCleanest:e?t.sg.colors.brandColors.colorBrandPrimary:t.sg.colors.neutralColors.colorNeutralDark};
50
+ font-weight: ${({isOptionSelected:e})=>e?t.sg.fonts.fontWeight.fontWeightSemiBold:t.sg.fonts.fontWeight.fontWeightRegular};
51
+ min-width: 0;
52
+ & > p {
53
+ display: -webkit-box;
54
+ ${({truncateText:e})=>e&&o.Ae`
55
+ -webkit-line-clamp: 2;
56
+ -webkit-box-orient: vertical;
57
+ overflow: hidden;
58
+ `}
59
+ text-overflow: ellipsis;
60
+ }
61
+
62
+ ${({hasDescription:e})=>e&&o.Ae`
63
+ line-height: ${t.sg.fonts.lineHeight.lineHeightMd(t.sg.fonts.fontSize.fontSizeBodyMd)};
64
+
65
+ & > p:nth-child(2) {
66
+ font-size: ${({size:n})=>n==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
67
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
68
+ color: ${({disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCleanest:t.sg.colors.neutralColors.colorNeutralCloudy};
69
+ }
70
+ `}
71
+ `,me=o.qe.li`
72
+ ${H.resetStyles}
73
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
74
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
75
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightSemiBold};
76
+ line-height: ${({size:e})=>e==="Small"?t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodySm):t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
77
+ color: ${t.sg.colors.neutralColors.colorNeutralCleanest};
78
+ padding: 0 ${t.sg.spacings.spacingInline.spacingInlineXs};
79
+ margin: ${({size:e})=>e==="Small"?`${t.sg.spacings.spacingStack.spacingStackSm} ${t.sg.spacings.spacingInline.spacingInlineXs}
80
+ ${t.sg.spacings.spacingStack.spacingStackNano}`:`${t.sg.spacings.spacingStack.spacingStackSm} ${t.sg.spacings.spacingInline.spacingInlineXs}
81
+ ${t.sg.spacings.spacingStack.spacingStackXs}`};
82
+ `,pe=o.qe.span`
83
+ ${H.resetStyles}
84
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
85
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
86
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightSemiBold};
87
+ line-height: ${({size:e})=>e==="Small"?t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd):t.sg.fonts.lineHeight.lineHeightMd(t.sg.fonts.fontSize.fontSizeBodyLg)};
88
+ `,Se=o.qe.div`
89
+ ${H.resetStyles}
90
+ display: flex;
91
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
92
+
93
+ & > p {
94
+ width: 100%;
95
+ ${({truncateText:e})=>e&&o.Ae`
96
+ display: -webkit-box;
97
+ -webkit-line-clamp: 2;
98
+ -webkit-box-orient: vertical;
99
+ `}
100
+ overflow: hidden;
101
+ text-overflow: ellipsis;
102
+ text-align: start;
103
+ }
104
+ `,be=o.qe.div`
105
+ ${H.resetStyles}
106
+ display: flex;
107
+ flex-direction: row;
108
+ align-items: center;
109
+ padding: ${({menuLateralPadding:e})=>e?`0 ${e}`:`0 ${t.sg.spacings.spacingInline.spacingInlineXs}`};
110
+ margin: 0 ${t.sg.spacings.spacingInline.spacingInlineXs};
111
+ cursor: ${({isOptionSelected:e,disabled:n})=>e||n?"default":"pointer"};
112
+ background-color: ${({highlightedIndex:e,disabled:n})=>e?n?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralLight:t.sg.colors.backgroundColors.colorBackgroundSnow};
113
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
114
+ min-height: ${({size:e})=>e==="Small"?"28px":"40px"};
115
+ `,$e=o.qe.div`
116
+ ${H.resetStyles}
117
+ padding: ${({iconPosition:e})=>e==="left"?`0 ${t.sg.spacings.spacingInline.spacingInlineNano} 0 0`:`0 0 0 ${t.sg.spacings.spacingInline.spacingInlineNano}`};
118
+ margin: 0;
119
+ display: flex;
120
+ align-self: center;
121
+ `,we=(e,n,i=0,s=0,a="left")=>{const[c,l]=u.useState(0),[x,d]=u.useState(),m=u.useRef(null),p=u.useCallback(()=>{if(!e.current||!m.current)return;const f=e.current.getBoundingClientRect(),S=m.current.getBoundingClientRect(),h=window.innerHeight,j=window.innerWidth,R=f.top,E=h-f.bottom,F=E<S.height+s&&R>E;let b;F?(b=f.top-S.height-i,m.current.style.maxHeight=`${R-i}px`):(b=f.bottom+s,m.current.style.maxHeight=`${E-s}px`);let W=f.left;const v=W+S.width-j;v>0&&(W-=v),W<0&&(W=0);const C=j-f.right;Object.assign(m.current.style,{position:"fixed",top:`${b}px`,...a==="left"?{left:`${W}px`}:{right:`${C}px`},width:`${Math.max(f.width,S.width)}px`,overflowY:"auto"})},[i,s,a]);return u.useEffect(()=>{var S;l(0),d((S=e.current)==null?void 0:S.clientWidth),p();const f=()=>p();return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[e,p]),{highlightedIndex:c,setHighlightedIndex:l,isOptionSelected:f=>f.label===(n==null?void 0:n.label),optionsRef:m,parentWidth:x}},J=u.forwardRef(({selectContainerRef:e,optionsSelect:n,size:i,selectOption:s,value:a,inputValue:c,widthMenu:l,maxHeightMenu:x="180px",menuIsOpen:d,onEnter:m,marginTop:p="4px",iconName:f,iconColor:S,iconPosition:h,topOffset:j=0,bottomOffset:R=0,truncateText:E=!0,menuJustifyContent:F="flex-start",tableActionButton:b,menuLateralPadding:W="8px",menuOptionFlexDirection:v="column",confirmSelection:C,menuAlign:O="left"},L)=>{H.valuable(f)&&(f+="Ant");const{highlightedIndex:T,setHighlightedIndex:$,isOptionSelected:w,optionsRef:I,parentWidth:M}=we(e,a,j,R,O);u.useEffect(()=>{const r=y=>{if(d){if(y.key==="ArrowDown")y.preventDefault(),$(z=>z<n.length-1?z+1:z);else if(y.key==="ArrowUp")y.preventDefault(),$(z=>z>0?z-1:0);else if(y.key==="Enter"&&n[T]){y.preventDefault();const z=n[T];s(z),m&&m(z)}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[d,n,T,m,s,C]);const k=r=>typeof r=="string"?r:u.isValidElement(r)&&typeof r.props.children=="string"?r.props.children:String(r),g=(r,y)=>{var A,N;if(h!==y)return null;const z=H.valuable((A=r.tooltipProps)==null?void 0:A.label),B=r.iconName||f||"InfoFill0Sm",P=o.jsxRuntimeExports.jsx($e,{iconPosition:(N=r.tooltipProps)==null?void 0:N.position,id:`iconContainer-${r.value}`,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:B,color:r.disabled?t.sg.colors.neutralColors.colorNeutralCleanest:w(r)?t.sg.colors.brandColors.colorBrandSoft:S??t.sg.colors.neutralColors.colorNeutralDark})});return z?o.jsxRuntimeExports.jsx(o.Tooltip,{...r==null?void 0:r.tooltipProps,isActive:!0,children:P}):P};return o.jsxRuntimeExports.jsx(fe,{marginTop:p,width:l??`${M}px`,maxHeight:x,height:"fit-content",ref:r=>{I.current=r,typeof L=="function"?L(r):L&&(L.current=r)},"data-testid":"MenuSelect",id:"MenuSelect",children:n.length===0?o.jsxRuntimeExports.jsx(he,{size:i,children:"Sem opções"}):n.map((r,y)=>{var P,A;const z=typeof r.render=="function"?r.render():null,B=k(r.label);if(r.isSection)return o.jsxRuntimeExports.jsx(me,{size:i,children:B},B);{const N=B.toLowerCase().indexOf((c==null?void 0:c.toLowerCase())||"");return o.jsxRuntimeExports.jsxs(be,{isOptionSelected:w(r),highlightedIndex:y===T,onClick:D=>{D.stopPropagation(),r.disabled||(C?o.showConfirm({id:"select-option",title:C.title,description:C.description,icon:C.icon,iconColor:C.iconColor,leftButtonProps:{name:"Cancelar",variant:"tertiary",onClick:()=>{}},rightButtonProps:{name:"Confirmar",variant:"secondary",onClick:()=>s(r)}}):s(r))},onMouseEnter:()=>$(y),disabled:r.disabled,size:i,menuLateralPadding:W,children:[g(r,"left"),o.jsxRuntimeExports.jsxs(xe,{menuOptionFlexDirection:v,menuJustifyContent:F,iconName:f,isOptionSelected:w(r),highlightedIndex:y===T,"data-testid":r.value,size:i,hasDescription:!!r.description,optionValue:r.value,disabled:r.disabled,truncateText:E,tableActionButton:b,children:[o.jsxRuntimeExports.jsxs(Se,{truncateText:!u.isValidElement(r.label)&&E,children:[z,u.isValidElement(r.label)?o.jsxRuntimeExports.jsx("p",{title:((P=r==null?void 0:r.tooltipProps)==null?void 0:P.label)??k(r.label),children:r.label}):o.jsxRuntimeExports.jsx("p",{title:((A=r==null?void 0:r.tooltipProps)==null?void 0:A.label)??B,children:c&&N>=0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[B.substring(0,N),o.jsxRuntimeExports.jsx(pe,{size:i,children:B.substring(N,N+((c==null?void 0:c.length)||0))}),B.substring(N+((c==null?void 0:c.length)||0))]}):B})]}),r.description&&o.jsxRuntimeExports.jsx("p",{title:r.description,children:r.description})]}),g(r,"right")]},String(r.value))}})})});J.displayName="MenuSelect";const ne=({title:e,iconName:n,onClickIcon:i,width:s,height:a,flex:c,children:l,wrapperCustomStyles:x={},contentCustomStyles:d={},titleCustomStyles:m={}})=>o.jsxRuntimeExports.jsxs(o.Container,{width:s,height:a,flex:c,direction:"vertical",padding:t.sg.spacings.spacingStack.spacingStackSm,customStyles:{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:"8px",...x},children:[o.jsxRuntimeExports.jsxs(o.Container,{width:"100%",direction:"horizontal",customStyles:d,children:[e?o.jsxRuntimeExports.jsx(o.Container,{width:"fit-content",customStyles:m,children:o.jsxRuntimeExports.jsx(o.SectionTitle,{title:e,divider:!1})}):null,n?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(o.Spacer,{size:"auto",direction:"horizontal"}),o.jsxRuntimeExports.jsx(t.Icon,{iconName:n,onClick:()=>i==null?void 0:i(),color:H.valuable(i)?t.sg.colors.neutralColors.colorNeutralDark:t.sg.colors.neutralColors.colorNeutralCloudy,cursorPointer:H.valuable(i)})]}):null]}),o.jsxRuntimeExports.jsx(o.Container,{width:"100%",flex:"1",children:l})]});ne.displayName="Section";const ye=o.qe.div`
122
+ ${H.resetStyles}
123
+ display: flex;
124
+ flex-direction: column;
125
+ width: ${({width:e})=>e};
126
+
127
+ &:hover {
128
+ cursor: ${({disabled:e,readonly:n})=>e||n?"default":"pointer"};
129
+ }
130
+ `,je=o.qe.div`
131
+ width: 100%;
132
+ ${({variant:e})=>e==="default"?o.Ae`
133
+ min-height: ${({size:n})=>n==="Small"?"3.2rem":"4rem"};
134
+ max-height: ${({size:n})=>n==="Small"?"3.2rem":"4rem"};
135
+ `:o.Ae`
136
+ min-height: ${({size:n})=>n==="Small"?"1rem":"3.2rem"};
137
+ max-height: ${({size:n})=>n==="Small"?"1rem":"3.2rem"};
138
+ `}
139
+
140
+ display: flex;
141
+ align-items: center;
142
+ ${({variant:e})=>e==="default"&&o.Ae`
143
+ border: ${t.sg.borders.borderWidth.borderWidthThinner} solid;
144
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
145
+ border-color: ${({isOpen:n,hasError:i,readonly:s,disabled:a})=>i?t.sg.colors.feedbackColors.colorFeedbackError:s||a?t.sg.colors.neutralColors.colorNeutralClean:n?t.sg.colors.neutralColors.colorNeutralCloudy:t.sg.colors.neutralColors.colorNeutralClean};
146
+ `}
147
+
148
+ background-color: ${({variant:e})=>e==="default"?t.sg.colors.backgroundColors.colorBackgroundSnow:"transparent"};
149
+ outline: none;
150
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
151
+ padding: ${({size:e,variant:n})=>{if(n==="default")return e!=="Small"?`0 ${t.sg.spacings.spacingInline.spacingInlineSm}`:`0 ${t.sg.spacings.spacingInline.spacingInlineAnt}`}};
152
+ ${({size:e,variant:n})=>e==="Small"?n==="default"?o.Ae`
153
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
154
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
155
+ `:o.Ae`
156
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodySm};
157
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodySm)};
158
+ `:n==="default"?o.Ae`
159
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyLg};
160
+ line-height: ${t.sg.fonts.lineHeight.lineHeightMd(t.sg.fonts.fontSize.fontSizeBodyLg)};
161
+ `:o.Ae`
162
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
163
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
164
+ `};
165
+ ${({disabled:e,readonly:n})=>(e||n)&&o.Ae`
166
+ background-color: ${t.sg.colors.brandColors.colorBrandSeSoft};
167
+ border-style: solid;
168
+ `};
169
+
170
+ & > svg {
171
+ width: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
172
+ height: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
173
+ margin-left: ${t.sg.spacings.spacingInline.spacingInlineXs};
174
+
175
+ path {
176
+ fill: ${({disabled:e,readonly:n})=>t.sg.colors.neutralColors.colorNeutralCloudy};
177
+ }
178
+ }
179
+ `,Ce=o.qe.div`
180
+ align-items: center;
181
+ display: flex;
182
+ flex: 1 1 0%;
183
+ flex-wrap: wrap;
184
+ position: relative;
185
+ overflow: hidden;
186
+ min-height: 1em;
187
+ box-sizing: border-box;
188
+ `,te=o.qe.span`
189
+ display: flex;
190
+ flex-wrap: wrap;
191
+ width: ${({isDisplayText:e})=>e?"100%":"fit-content"};
192
+ max-width: calc(100% - 20px);
193
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
194
+ font-weight: 400;
195
+ font-size: ${({size:e,variant:n})=>n==="default"?e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg:e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
196
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
197
+ & > p {
198
+ text-overflow: ellipsis;
199
+ white-space: nowrap;
200
+ overflow: hidden;
201
+ width: ${({isDisplayText:e})=>e?"100%":"fit-content"};
202
+ font-style: ${({isDisplayText:e})=>e?"italic":"normal"};
203
+ }
204
+ `,Re=o.qe.span`
205
+ color: ${t.sg.colors.neutralColors.colorNeutralCleanest};
206
+ font-size: ${({size:e,variant:n})=>n==="default"?e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg:e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
207
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
208
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
209
+ text-overflow: ellipsis;
210
+ white-space: nowrap;
211
+ overflow: hidden;
212
+ width: fit-content;
213
+ `,ke=o.qe.input`
214
+ flex: 1;
215
+ min-width: 0.1rem;
216
+ border: none;
217
+ background-color: transparent;
218
+
219
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
220
+ font-size: ${({size:e,variant:n})=>n==="default"?e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg:e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
221
+
222
+ &:focus,
223
+ &:hover {
224
+ outline: none;
225
+ cursor: ${({disabled:e,readOnly:n})=>e||n?"default":"pointer"};
226
+ }
227
+ `,Ee=o.qe.div`
228
+ width: 100%;
229
+ display: flex;
230
+ flex-direction: row;
231
+ gap: 4px;
232
+ justify-content: flex-start;
233
+ margin-bottom: ${t.sg.spacings.spacingStack.spacingStackNano};
234
+ `,ze=o.qe.label`
235
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
236
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
237
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
238
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
239
+ color: ${t.sg.colors.neutralColors.colorNeutralCloudy};
240
+ margin-bottom: ${t.sg.spacings.spacingStack.spacingStackNano};
241
+ `,Be=o.qe.label`
242
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
243
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
244
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
245
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
246
+ color: ${t.sg.colors.feedbackColors.colorFeedbackError};
247
+ `;o.qe.p`
248
+ display: inline-block;
249
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
250
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
251
+ color: ${t.sg.colors.feedbackColors.colorFeedbackError};
252
+ margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
253
+ width: 100%;
254
+ `;const Ne=o.qe.p`
255
+ display: inline-block;
256
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodySm:t.sg.fonts.fontSize.fontSizeBodyMd};
257
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
258
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
259
+ margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
260
+ width: 100%;
261
+ `,We=(e,{value:n,options:i})=>{const[s,a]=u.useState(!1),[c,l]=u.useState(!1),[x,d]=u.useState(""),[m,p]=u.useState(i),f=u.useRef(null),S=u.useRef(null),h=u.useRef(null),j=u.useRef(null);u.useEffect(()=>{const b=()=>{l(!1)};return window.addEventListener("scroll",b,{passive:!0}),window.addEventListener("resize",b,{passive:!0}),()=>{window.removeEventListener("scroll",b),window.removeEventListener("resize",b)}},[]);function R(b){d(""),l(!1),a(!0),h!=null&&h.current&&h.current.focus(),b!==n&&e(b)}const E=b=>{if(b){const W=new RegExp(b,"i"),v=i.filter(C=>W.exec(C.label));p(v)}else p(i)};function F(b){return!b}return{isOpen:s,setIsOpen:a,expanded:c,setExpanded:l,inputValue:x,setInputValue:d,optionsSelect:m,setOptionSelect:p,selectContainerRef:f,containerRef:S,inputContainerRef:h,optionsRef:j,selectOption:R,handlerFilterOptions:E,isValue:F}},K=u.forwardRef(({value:e,handleOption:n,options:i,filter:s=!0,placeholder:a,label:c,size:l="Medium",width:x="100%",disabled:d,helpText:m,readonly:p,errorMessage:f,tooltipProps:S={},onBlur:h,onEnter:j,variant:R="default",infoProps:E={},maxHeightMenu:F,isRequired:b=!1,onRemoveSelected:W,displayText:v,displayTextProps:C={}},O)=>{const{isOpen:L,setIsOpen:T,expanded:$,setExpanded:w,inputValue:I,setInputValue:M,optionsSelect:k,selectContainerRef:g,containerRef:r,inputContainerRef:y,selectOption:z,setOptionSelect:B,handlerFilterOptions:P,isValue:A}=We(n,{value:e,options:i}),N=!!f,D={label:f,...S,wrapperWidth:"auto",isActive:N,isErrorTooltip:!0},q={...E,size:l},_=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`Close${l==="Small"?"Sm":"Ant"}`,onClick:X=>{X.stopPropagation(),W(e)}}),V=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${l==="Small"?"Sm":"Ant"}`}),le=o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${l==="Small"?"Sm":"Ant"}`});return o.jsxRuntimeExports.jsxs(ye,{ref:g,width:x,size:l,disabled:d,readonly:p,children:[c&&o.jsxRuntimeExports.jsxs(Ee,{children:[o.jsxRuntimeExports.jsxs(ze,{"data-testid":"label",ref:O,children:[c,b&&!d?o.jsxRuntimeExports.jsx(Be,{children:" *"}):null]}),((q==null?void 0:q.message)||(q==null?void 0:q.render))&&o.jsxRuntimeExports.jsx(o.Info,{...q})]}),o.jsxRuntimeExports.jsx(o.Tooltip,{...D,children:o.jsxRuntimeExports.jsxs(je,{hasError:N,readonly:p,ref:r,onBlur:()=>{setTimeout(()=>{(L||$)&&y.current!==document.activeElement&&(h&&h(e),T(!1),w(!1))},250)},onClick:()=>{!d&&!p&&(L&&!$?(w(!0),y!=null&&y.current&&y.current.focus()):!L&&!$?(T(!0),w(!0),y!=null&&y.current&&y.current.focus()):(T(!1),w(!1),y!=null&&y.current&&y.current.blur()),!I&&B(i))},tabIndex:0,width:x,size:l,isOpen:L||$,"data-testid":"select",disabled:d,helpText:m,variant:R,children:[o.jsxRuntimeExports.jsxs(Ce,{children:[H.valuable(v)?o.jsxRuntimeExports.jsx(te,{size:l,variant:R,isDisplayText:!0,children:o.jsxRuntimeExports.jsx("p",{title:e==null?void 0:e.label,...C,children:v})}):o.jsxRuntimeExports.jsxs(te,{size:l,variant:R,children:[a&&A(e)&&!I&&!L?o.jsxRuntimeExports.jsx(Re,{size:l,variant:R,children:a}):null,(e==null?void 0:e.label)&&o.jsxRuntimeExports.jsx("p",{title:(e==null?void 0:e.hint)??(e==null?void 0:e.label),children:e==null?void 0:e.label})]}),s&&!H.valuable(v)&&o.jsxRuntimeExports.jsx(ke,{ref:y,value:I,onChange:X=>{M(X.target.value),X.target.value.length>0&&(T(!0),w(!0)),P(X.target.value)},readOnly:p,width:I.length,size:l,disabled:d,variant:R})]}),W&&e?_:null,$?V:le,$&&o.jsxRuntimeExports.jsx(J,{onEnter:X=>{n&&n(X),T(!1),w(!1),j&&j(X)},menuIsOpen:L,selectContainerRef:g,value:e,optionsSelect:k,selectOption:z,size:l,inputValue:I,maxHeightMenu:F})]})}),m&&o.jsxRuntimeExports.jsx(Ne,{size:l,children:m})]})});K.displayName="Select";const re=o.We`
262
+ from {
263
+ transform: rotate(0deg);
264
+ }
265
+ to {
266
+ transform: rotate(360deg);
267
+ }
268
+ `,Ie=o.qe.button`
269
+ display: flex;
270
+ justify-content: space-between;
271
+ align-items: center;
272
+ gap: 0.5rem;
273
+ padding: ${({size:e})=>e==="Small"?`0 ${t.sg.spacings.spacingInline.spacingInlineAnt}`:`0 ${t.sg.spacings.spacingInline.spacingInlineSm}`};
274
+ ${({variant:e})=>{if(e==="primary")return o.Ae`
275
+ background-color: ${t.sg.colors.brandColors.colorBrandPrimary};
276
+ color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
277
+ transition: filter 0.2s;
278
+ cursor: pointer;
279
+
280
+ &:hover {
281
+ background-color: ${t.sg.colors.brandColors.colorBrandDark};
282
+ }
283
+ `;if(e==="secondary")return o.Ae`
284
+ background-color: rgba(
285
+ ${H.convertHexToRGB(t.sg.colors.neutralColors.colorNeutralSoft)},
286
+ ${t.sg.opacityLevels.light}
287
+ );
288
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
289
+ border: 1px solid ${t.sg.colors.neutralColors.colorNeutralClean};
290
+ transition: filter 0.2s;
291
+ cursor: pointer;
292
+
293
+ &:hover {
294
+ border-color: ${t.sg.colors.neutralColors.colorNeutralCleanest};
295
+ }
296
+ `;if(e==="tertiary")return o.Ae`
297
+ background-color: transparent;
298
+ color: ${t.sg.colors.neutralColors.colorNeutralDark};
299
+ border: ${t.sg.borders.borderWidth.borderWidthNone};
300
+ transition: filter 0.2s;
301
+ cursor: pointer;
302
+
303
+ &:hover {
304
+ border: 1px solid ${t.sg.colors.neutralColors.colorNeutralClean};
305
+ }
306
+ `}};
307
+ ${({disabled:e})=>e&&o.Ae`
308
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundGrass};
309
+ color: ${t.sg.colors.neutralColors.colorNeutralCloudy};
310
+ transition: filter 0.2s;
311
+ cursor: not-allowed;
312
+
313
+ &:hover {
314
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundGrass};
315
+ }
316
+ `}
317
+
318
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
319
+ font-size: ${({size:e})=>e==="Small"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodyLg};
320
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
321
+ width: 100%;
322
+ min-height: ${({size:e})=>e==="Small"?"3.2rem":"4rem"};
323
+ max-height: ${({size:e})=>e==="Small"?"3.2rem":"4rem"};
324
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusSm};
325
+ & > p {
326
+ text-align: center;
327
+ width: 100%;
328
+ overflow: hidden;
329
+ text-overflow: ellipsis;
330
+ white-space: nowrap;
331
+ }
332
+ & > svg {
333
+ min-width: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
334
+ height: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
335
+
336
+ ${({isLoading:e})=>e&&o.Ae`
337
+ animation: ${re} 2s linear infinite;
338
+ `}
339
+
340
+ path {
341
+ fill: ${({variant:e,disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCloudy:e==="primary"?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralDark};
342
+ }
343
+ }
344
+ `,ve=o.qe.div`
345
+ display: flex;
346
+ flex-direction: column;
347
+ width: ${({width:e})=>e};
348
+
349
+ &:hover {
350
+ cursor: ${({disabled:e})=>e&&"not-allowed"};
351
+ }
352
+ `,Me=o.qe.label`
353
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
354
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
355
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
356
+ line-height: ${t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd)};
357
+ color: ${({hasError:e})=>e?`${t.sg.colors.feedbackColors.colorFeedbackError}`:`${t.sg.colors.neutralColors.colorNeutralCloudy}`};
358
+ margin-bottom: ${t.sg.spacings.spacingStack.spacingStackNano};
359
+ `;o.qe.p`
360
+ display: inline-block;
361
+ font-size: ${t.sg.fonts.fontSize.fontSizeBodyMd};
362
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
363
+ color: ${t.sg.colors.feedbackColors.colorFeedbackError};
364
+ margin-top: ${t.sg.spacings.spacingInline.spacingInlineNano};
365
+ width: 100%;
366
+ `;const Ae=o.qe.div`
367
+ width: 100%;
368
+
369
+ & > svg {
370
+ min-width: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
371
+ height: ${({size:e})=>e==="Small"?t.sg.icons.iconSizeSm:t.sg.icons.iconSizeAnt};
372
+
373
+ animation: ${re} 2s linear infinite;
374
+
375
+ path {
376
+ fill: ${({variant:e,disabled:n})=>n?t.sg.colors.neutralColors.colorNeutralCloudy:e==="primary"?t.sg.colors.backgroundColors.colorBackgroundSnow:t.sg.colors.neutralColors.colorNeutralDark};
377
+ }
378
+ }
379
+
380
+ &:hover {
381
+ cursor: not-allowed;
382
+ }
383
+ `,Fe=e=>{const[n,i]=u.useState(!1),[s,a]=u.useState(e),c=u.useRef(null);return u.useEffect(()=>{a(e)},[e]),{setIsOpen:i,isOpen:n,setOptionsSelect:a,optionsSelect:s,selectContainerRef:c}},He=200,Le=({name:e,variant:n="primary",width:i="100%",size:s="Medium",disabled:a=!1,isLoading:c=!1,onClick:l,options:x,label:d,menuSelectProps:m={},iconName:p,optionsIconPosition:f})=>{const{isOpen:S,setIsOpen:h,selectContainerRef:j,optionsSelect:R}=Fe(x);let E=t.sg.colors.backgroundColors.colorBackgroundSnow;a?E=t.sg.colors.neutralColors.colorNeutralCloudy:n!=="primary"&&(E=t.sg.colors.neutralColors.colorNeutralDark);const F={...m};return o.jsxRuntimeExports.jsxs(ve,{ref:j,width:i,size:s,disabled:a,onBlur:()=>setTimeout(()=>h(!1),He),children:[d&&o.jsxRuntimeExports.jsx(Me,{children:d}),o.jsxRuntimeExports.jsxs(Ie,{type:"button",size:s,disabled:a,variant:n,isLoading:c,onClick:()=>!c&&h(!S),id:`button-component-${e}`,children:[c&&o.jsxRuntimeExports.jsx(Ae,{size:s,disabled:a,variant:n,children:o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ProgressActivity${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-loading"})}),!c&&o.jsxRuntimeExports.jsx("p",{title:e,children:e}),!c&&(S?o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandLess${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-button-less"}):o.jsxRuntimeExports.jsx(t.Icon,{iconName:`ExpandMore${s==="Small"?"Ant":"Sm"}`,color:E,"data-testid":"icon-button-more"}))]}),S&&o.jsxRuntimeExports.jsx(J,{selectContainerRef:j,value:null,optionsSelect:R,selectOption:l,size:s,inputValue:null,iconPosition:f,iconName:p,...F})]})},Te=o.qe.div`
384
+ min-width: ${({widthItems:e})=>e};
385
+ max-width: ${({widthItems:e})=>e};
386
+ height: 100%;
387
+ overflow: hidden;
388
+
389
+ &:hover {
390
+ overflow: auto;
391
+ scroll-padding-top: 10px;
392
+ }
393
+ `,qe=o.qe.div`
394
+ width: 100%;
395
+ min-height: ${({heightItems:e})=>e};
396
+ max-height: ${({heightItems:e})=>e};
397
+ background-color: ${({selected:e})=>e?"#E8F3FF":"transparent"};
398
+ border-bottom: ${`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
399
+ padding: 8px;
400
+ ${({withBorderRight:e})=>e&&o.Ae`
401
+ border-right: ${({selected:n})=>n?"none":`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
402
+ `}
403
+ cursor: pointer;
404
+ `,Pe=o.qe.div`
405
+ max-width: 4px;
406
+ min-width: 4px;
407
+ min-height: ${({heightItems:e})=>e};
408
+ max-height: ${({heightItems:e})=>e};
409
+ background-color: ${({selected:e})=>e?"#E8F3FF":"transparent"};
410
+ border-bottom: ${`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
411
+ padding: 8px;
412
+ ${({withBorderRight:e})=>e&&o.Ae`
413
+ border-right: ${({selected:n})=>n?"none":`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`};
414
+ `}
415
+ cursor: pointer;
416
+ `,De=o.qe.div`
417
+ display: flex;
418
+ min-width: 0;
419
+ height: 100%;
420
+ flex: 1;
421
+ background-color: #e8f3ff;
422
+ `,Oe=o.qe.div`
423
+ max-width: 4px;
424
+ min-width: 4px;
425
+ height: 100%;
426
+ background-color: 'transparent';
427
+ overflow: hidden;
428
+ `,Xe=({width:e="100%",height:n="fit-content",flex:i,backgroundColor:s="white",options:a=[],heightItems:c="60px",widthItems:l="155px",emptyProps:x={title:"Nenhum dado a ser mostrado",body:null}})=>{var S;const[d,m]=u.useState(a[0]||null),p=u.useRef(null),f=u.useRef(null);return u.useEffect(()=>{const h=p.current,j=f.current,R=()=>{h&&j&&(j.scrollTop=h.scrollTop)};return h==null||h.addEventListener("scroll",R),()=>{h==null||h.removeEventListener("scroll",R)}},[]),(a==null?void 0:a.length)===0?o.jsxRuntimeExports.jsx(o.Empty,{title:x.title,body:x.body,flex:"1",mode:"table"}):o.jsxRuntimeExports.jsxs(o.Container,{width:e,height:n,flex:i,backgroundColor:s,direction:"horizontal",customStyles:{border:`1px solid ${t.sg.colors.neutralColors.colorNeutralSoft}`,borderRadius:t.sg.borders.borderRadius.borderRadiusSm},children:[o.jsxRuntimeExports.jsx(Te,{ref:p,widthItems:l,children:a==null?void 0:a.map((h,j)=>o.jsxRuntimeExports.jsx(qe,{selected:(d==null?void 0:d.key)===h.key,onClick:()=>m(h),withBorderRight:!1,heightItems:c,children:h.item},j))}),o.jsxRuntimeExports.jsx(Oe,{ref:f,children:(S=a==null?void 0:a.concat({key:"last",item:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{}),contentItem:o.jsxRuntimeExports.jsx(o.jsxRuntimeExports.Fragment,{})}))==null?void 0:S.map((h,j)=>o.jsxRuntimeExports.jsx(Pe,{selected:(d==null?void 0:d.key)===h.key,onClick:()=>m(h),withBorderRight:!0,heightItems:c},j))}),o.jsxRuntimeExports.jsx(De,{children:d&&(d==null?void 0:d.contentItem)})]})},se=o.Ae`
429
+ svg:not([color]):not([data-testid='icon']) {
430
+ path {
431
+ fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
432
+ }
433
+ }
434
+
435
+ div:not([color]) > svg[data-testid='icon'] {
436
+ path {
437
+ fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
438
+ }
439
+ }
440
+ `,_e=o.qe.div`
441
+ width: 100%;
442
+ max-height: ${({maxHeight:e})=>e};
443
+ overflow: auto;
444
+ position: relative;
445
+ border: ${t.sg.borders.borderWidth.borderWidthThinner} solid
446
+ ${t.sg.colors.neutralColors.colorNeutralSoft};
447
+ border-radius: ${({withBorderRadius:e,borderRadius:n})=>n||(e?t.sg.borders.borderRadius.borderExtraSmall:"none")};
448
+
449
+ ::-webkit-scrollbar {
450
+ width: 6px;
451
+ }
452
+
453
+ ::-webkit-scrollbar-track {
454
+ background: ${t.sg.colors.neutralColors.colorNeutralSoft};
455
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
456
+ }
457
+
458
+ ::-webkit-scrollbar-thumb {
459
+ background: ${t.sg.colors.neutralColors.colorNeutralClean};
460
+ border-radius: ${t.sg.borders.borderRadius.borderRadiusPill};
461
+ }
462
+ `,Ue=o.qe.table`
463
+ border-collapse: separate;
464
+ border-spacing: 0;
465
+ width: 100%;
466
+ `,Ge=`${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall} 0 0`,Je=`0 0 ${t.sg.borders.borderRadius.borderExtraSmall} ${t.sg.borders.borderRadius.borderExtraSmall}`,U=o.qe.tr`
467
+ ${({isHeader:e,size:n})=>e&&o.Ae`
468
+ position: sticky;
469
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundSnow};
470
+
471
+ &:first-child {
472
+ top: 0;
473
+ z-index: 2;
474
+ }
475
+
476
+ &:nth-child(2) {
477
+ top: ${n==="Large"?"4rem":"3.2rem"};
478
+ z-index: 1;
479
+ }
480
+ `}
481
+
482
+ height: ${({fit:e,size:n})=>e?"fit-content":n==="Large"?"4rem":"3.2rem"};
483
+ min-height: ${({size:e})=>e==="Large"?"4rem":"3.2rem"};
484
+
485
+ ${({isHeader:e,isSelected:n,striped:i})=>!e&&o.Ae`
486
+ background-color: ${n?t.sg.colors.neutralColors.colorNeutralClean:i?"#F5F9FE":t.sg.colors.backgroundColors.colorBackgroundSnow};
487
+ `}
488
+
489
+ border-radius: ${({isFirst:e,isLast:n,isHeader:i,borderRadius:s})=>{if(e&&!i)return s?`${s} ${s} 0 0`:Ge;if(n)return s?`0 0 ${s} ${s}`:Je}};
490
+ transition: background-color 0.2s 0s;
491
+
492
+ &:hover {
493
+ background-color: ${({isSelected:e})=>e?t.sg.colors.neutralColors.colorNeutralCleanest:t.sg.colors.backgroundColors.colorBackgroundCarpet};
494
+ }
495
+
496
+ &:last-child {
497
+ border-bottom: none !important;
498
+ }
499
+
500
+ ${({isHeader:e})=>!e&&o.Ae`
501
+ &:hover {
502
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundCarpet};
503
+
504
+ /* Target direct SVGs without color (sbwb-icons), but exclude sbwb-ds Icons ([data-testid='icon'])
505
+ * This is because sbwb-ds Icons have a color prop on the wrapper, not the SVG
506
+ */
507
+ ${se}
508
+ }
509
+ `}
510
+ `,ie=({width:e})=>{if(H.valuable(e))return o.Ae`
511
+ width: ${e};
512
+ `},G=o.qe.th`
513
+ text-align: ${({horizontalAlign:e,headerAlign:n})=>e??n??"left"};
514
+ vertical-align: middle;
515
+ min-width: ${({minWidth:e})=>e||"auto"};
516
+ max-width: ${({maxWidth:e})=>e};
517
+
518
+ ${ie}
519
+
520
+ height: ${({size:e})=>e==="Large"?"4rem":"3.2rem"};
521
+ background-color: ${t.sg.colors.backgroundColors.colorBackgroundSky};
522
+ padding: ${()=>`${t.sg.spacings.spacingInline.spacingInlineXs} ${t.sg.spacings.spacingInline.spacingInlineXs}`};
523
+
524
+ border-bottom: ${({withBorder:e})=>e?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
525
+ border-right: ${({withBorder:e})=>e?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
526
+
527
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
528
+ font-size: ${({columnsTextSize:e})=>e==="Large"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodySm};
529
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightBold};
530
+ line-height: ${({columnsTextSize:e})=>e==="Large"?t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd):t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodySm)};
531
+ color: ${t.sg.colors.neutralColors.colorNeutralBlack};
532
+
533
+ word-break: normal;
534
+
535
+ &:last-child {
536
+ ${({isTopRow:e})=>e&&o.Ae`
537
+ border-right: none;
538
+ `}
539
+ }
540
+
541
+ & > svg:not([color]):not([data-testid='icon']) {
542
+ path {
543
+ fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
544
+ }
545
+ }
546
+
547
+ & > div:not([color]) > svg[data-testid='icon'] {
548
+ path {
549
+ fill: ${t.sg.colors.neutralColors.colorNeutralDarkest};
550
+ }
551
+ }
552
+
553
+ &:hover {
554
+ cursor: default;
555
+ }
556
+ `,Ve=o.qe.td`
557
+ text-align: ${({horizontalAlign:e})=>e||"left"};
558
+ vertical-align: ${({verticalAlign:e})=>e||"middle"};
559
+
560
+ min-width: ${({minWidth:e})=>e||"auto"};
561
+ max-width: ${({maxWidth:e})=>e};
562
+ ${ie}
563
+
564
+ padding: ${({rowPadding:e})=>e??`${t.sg.spacings.spacingInline.spacingInlineXs}`};
565
+
566
+ font-family: ${t.sg.fonts.fontFamily.fontFamilyPrimary};
567
+ font-size: ${({size:e})=>e==="Large"?t.sg.fonts.fontSize.fontSizeBodyMd:t.sg.fonts.fontSize.fontSizeBodySm};
568
+ font-weight: ${t.sg.fonts.fontWeight.fontWeightRegular};
569
+ line-height: ${({size:e})=>e==="Large"?t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodyMd):t.sg.fonts.lineHeight.lineHeightSm(t.sg.fonts.fontSize.fontSizeBodySm)};
570
+ color: ${t.sg.colors.neutralColors.colorNeutralBlack};
571
+
572
+ word-break: normal;
573
+
574
+ border-bottom: ${({withBorder:e,isLast:n})=>e&&!n?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
575
+ border-right: ${({withBorder:e})=>e?`${t.sg.borders.borderWidth.borderWidthThinner} solid ${t.sg.colors.neutralColors.colorNeutralSoft}`:"none"};
576
+
577
+ &:last-child {
578
+ border-right: none;
579
+ }
580
+
581
+ ${se}
582
+
583
+ &:hover {
584
+ cursor: ${e=>e.isClickable?"pointer":"default"};
585
+ }
586
+ `;function Ye(e){return n=>typeof e=="string"?n[e]:typeof e=="function"?e(n):(console.warn("Please, setup a rowKey for table."),JSON.stringify(n))}function Qe({id:e,rowKey:n="id",size:i="Small",onRowClick:s,fit:a=!1,maxHeight:c="40rem",columns:l,dataSource:x,columnsTextSize:d=i,emptyProps:m={width:"100%",height:"100%",title:"Nenhum dado a ser mostrado.",mode:"table",borders:!0,backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow},selectedRow:p=!1,hideHeader:f=!1,withBorder:S=!0,withBorderRadius:h=!0,striped:j=!1,borderRadius:R=t.sg.borders.borderRadius.borderRadiusSm}){const E=u.useMemo(()=>Ye(n),[n]),[F,b]=u.useState(null),W=u.useRef(null),v=u.useRef(null),[C,O]=u.useState(l);u.useLayoutEffect(()=>{if(!v.current||l.length===0){O(l);return}const $=()=>{var P;const I=((P=v.current)==null?void 0:P.clientWidth)||0;if(I===0)return;let M=0,k=0;const g=[],r=[];l.forEach(A=>{const N=Number(A.flex);A.width?M+=parseInt(A.width,10)||0:A.flex&&N>0?(k+=N,g.push(A)):r.push(A)});const y=I-M,z="80";let B=[...l];if(y>0){if(g.length>0){const A=y/k;B=l.map(N=>{const D=Number(N.flex);if(D&&D>0){const q=parseInt(N.minWidth||z,10),_=D*A,V=Math.max(_,q);return{...N,width:`${Math.floor(V)}px`}}return!N.width&&!D?{...N,width:N.minWidth||`${z}px`}:N})}else if(r.length>0){const A=y/r.length;B=l.map(N=>{const D=Number(N.flex);if(!N.width&&!D){const q=parseInt(N.minWidth||z,10),_=Math.max(A,q);return{...N,width:`${Math.floor(_)}px`}}return N})}}else B=l.map(A=>A.width?A:{...A,width:A.minWidth||`${z}px`});O(B)};$();const w=new ResizeObserver($);return w.observe(v.current),()=>w.disconnect()},[l]),u.useEffect(()=>{const $=w=>{W.current&&!W.current.contains(w.target)&&b(null)};return document.addEventListener("mousedown",$),()=>{document.removeEventListener("mousedown",$)}},[]);const L=u.useMemo(()=>C?C.some($=>$.mergeHeaderId&&$.mergeHeaderLabel):!1,[C]),T=u.useMemo(()=>{var M,k;if(f||!C||C.length===0)return null;if(!L)return o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:1,borderRadius:R,children:C.map(g=>{var r;return o.jsxRuntimeExports.jsx(G,{width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,children:((r=g.columnRender)==null?void 0:r.call(g,x))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)})});const $=[],w=[];let I=0;for(;I<C.length;){const g=C[I];if(g.mergeHeaderId&&g.mergeHeaderLabel){let r=0;const y=g.mergeHeaderId;for(let z=I;z<C.length&&C[z].mergeHeaderId===y;z++)r++;$.push(o.jsxRuntimeExports.jsx(G,{colSpan:r,horizontalAlign:"center",size:i,columnsTextSize:d,withBorder:S,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,headerAlign:g.headerAlign,isTopRow:!0,children:o.jsxRuntimeExports.jsx("span",{title:g.mergeHeaderLabel,children:g.mergeHeaderLabel})},`${g.mergeHeaderId}-merged`));for(let z=0;z<r;z++){const B=C[I+z];w.push(o.jsxRuntimeExports.jsx(G,{width:B.width,minWidth:B.minWidth,maxWidth:B.maxWidth,horizontalAlign:B.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,children:((M=B.columnRender)==null?void 0:M.call(B,x))||o.jsxRuntimeExports.jsx("span",{title:B.label,children:B.label})},B.dataIndex+"-individual"))}I+=r}else $.push(o.jsxRuntimeExports.jsx(G,{rowSpan:2,width:g.width,minWidth:g.minWidth,maxWidth:g.maxWidth,horizontalAlign:g.horizontalAlign,size:i,columnsTextSize:d,withBorder:S,headerAlign:g.headerAlign,isTopRow:!0,children:((k=g.columnRender)==null?void 0:k.call(g,x))||o.jsxRuntimeExports.jsx("span",{title:g.label,children:g.label})},g.dataIndex)),I++}return o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:R,children:$}),w.length>0&&o.jsxRuntimeExports.jsx(U,{isHeader:!0,size:i,numRows:2,borderRadius:R,children:w})]})},[C,f,i,d,L]);return!x||x.length===0?o.jsxRuntimeExports.jsx(o.Empty,{backgroundColor:t.sg.colors.backgroundColors.colorBackgroundSnow,borders:!0,mode:"table",...m}):o.jsxRuntimeExports.jsx(_e,{maxHeight:c,withBorderRadius:h,ref:v,borderRadius:R,children:o.jsxRuntimeExports.jsxs(Ue,{id:e,ref:W,children:[o.jsxRuntimeExports.jsx("thead",{children:T}),o.jsxRuntimeExports.jsx("tbody",{style:{width:"100%"},children:x==null?void 0:x.map(($,w,I)=>{const M=E($);return o.jsxRuntimeExports.jsx(U,{isLast:w===I.length-1,fit:a,size:i,withBorder:S,isSelected:M===F&&p,striped:j&&w%2!==0,borderRadius:R,children:C.map(k=>{var g,r;return o.jsxRuntimeExports.jsx(Ve,{width:k.width,minWidth:k.minWidth,maxWidth:k.maxWidth,size:i,isClickable:H.valuable(s),onClick:()=>{s&&s($,k,w),p&&b(F===M?null:M)},horizontalAlign:k.horizontalAlign,verticalAlign:k.verticalAlign,rowPadding:k.rowPadding,withBorder:S,isLast:w===I.length-1,children:((g=k.render)==null?void 0:g.call(k,$[k.dataIndex],$,w,I))||o.jsxRuntimeExports.jsx("span",{title:$[k.dataIndex],style:{textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",...(r=k.rowCss)==null?void 0:r.call(k,$)},children:$[k.dataIndex]})||""},`${M}::${k.dataIndex}`)})},M)})})]})})}exports.CheckboxField=ue;exports.CollapseSection=ae;exports.MenuSelect=J;exports.Section=ne;exports.Select=K;exports.SelectButton=Le;exports.SelectField=ge;exports.TabInfo=Xe;exports.Table=Qe;exports.TextareaField=oe;