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