@ufal-lccv/gpsub-ds 0.0.22 → 0.0.23-alpha-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -31
- package/dist/{RequiredLabel.view-DXN5uPK2.js → RequiredLabel.view-BDLanjeI.js} +17 -17
- package/dist/{RequiredLabel.view-BxGOZl_G.cjs → RequiredLabel.view-C-eQ4uqx.cjs} +1 -1
- package/dist/{Table.view-qhca9qPp.cjs → Table.view-Cv1DHK6l.cjs} +1 -1
- package/dist/{Table.view-CaOutm0A.js → Table.view-D8G3WlLF.js} +22 -22
- package/dist/Title.view-DFAx8FpE.cjs +1 -0
- package/dist/Title.view-DMNyrCrH.js +54 -0
- package/dist/{Tooltip.view-CAXE23gx.cjs → Tooltip.view-CoRsYgPx.cjs} +123 -123
- package/dist/{Tooltip.view-ZTmLiut5.js → Tooltip.view-DXp_JUAk.js} +258 -242
- package/dist/components/atoms/LibraryCard/LibraryCard.view.d.ts +6 -2
- package/dist/components/atoms/index.cjs.js +1 -1
- package/dist/components/atoms/index.es.js +9 -9
- package/dist/components/index.cjs.js +1 -1
- package/dist/components/index.es.js +15 -15
- package/dist/components/molecules/index.cjs.js +1 -1
- package/dist/components/molecules/index.es.js +4 -4
- package/dist/components/organisms/index.cjs.js +1 -1
- package/dist/components/organisms/index.es.js +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.es.js +21 -21
- package/package.json +121 -121
- package/dist/Title.view-Bu6ZRsfK.cjs +0 -1
- package/dist/Title.view-DIVNVZPb.js +0 -74
package/README.md
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
# gpsub-ds
|
|
2
|
-
|
|
3
|
-
Design system temporário do GP-SUB para auxiliar na futura migração para o DS Subweb 2.0
|
|
4
|
-
|
|
5
|
-
## Atomic Design
|
|
6
|
-
|
|
7
|
-
Para dúvidas sobre o Atomic Design, consulte o [link](https://github.com/diegohaz/arc/wiki/Atomic-Design).
|
|
8
|
-
|
|
9
|
-
### Atoms
|
|
10
|
-
|
|
11
|
-
Um átomo é uma tag html nativa, um Componente React que renderiza uma tag html ou qualquer componente de terceiros
|
|
12
|
-
|
|
13
|
-
### Molecules
|
|
14
|
-
|
|
15
|
-
Uma molécula é um grupo de átomos.
|
|
16
|
-
|
|
17
|
-
### Organisms
|
|
18
|
-
|
|
19
|
-
Um organismo é um grupo de átomos, moléculas e/ou outros organismos.
|
|
20
|
-
|
|
21
|
-
### Pages
|
|
22
|
-
|
|
23
|
-
Uma página é uma página, onde você colocará principalmente (mas não exclusivamente) organismos.
|
|
24
|
-
|
|
25
|
-
### Templates
|
|
26
|
-
|
|
27
|
-
Um template é um layout para ser usado em páginas.
|
|
28
|
-
|
|
29
|
-
## Do not worry!
|
|
30
|
-
|
|
31
|
-
Atomic Design deve ser uma solução, não outro problema. Se você quiser criar um componente e não sabe onde colocá-lo (átomos, moléculas, organismos etc.), não se preocupe, não pense muito, apenas coloque-o em qualquer lugar. Depois de você perceber o que é, apenas mova a pasta do componente para o lugar certo. Tudo irá funcionar por que os componentes são exportados de forma dinâmica em `src/components/index.ts`.
|
|
1
|
+
# gpsub-ds
|
|
2
|
+
|
|
3
|
+
Design system temporário do GP-SUB para auxiliar na futura migração para o DS Subweb 2.0
|
|
4
|
+
|
|
5
|
+
## Atomic Design
|
|
6
|
+
|
|
7
|
+
Para dúvidas sobre o Atomic Design, consulte o [link](https://github.com/diegohaz/arc/wiki/Atomic-Design).
|
|
8
|
+
|
|
9
|
+
### Atoms
|
|
10
|
+
|
|
11
|
+
Um átomo é uma tag html nativa, um Componente React que renderiza uma tag html ou qualquer componente de terceiros
|
|
12
|
+
|
|
13
|
+
### Molecules
|
|
14
|
+
|
|
15
|
+
Uma molécula é um grupo de átomos.
|
|
16
|
+
|
|
17
|
+
### Organisms
|
|
18
|
+
|
|
19
|
+
Um organismo é um grupo de átomos, moléculas e/ou outros organismos.
|
|
20
|
+
|
|
21
|
+
### Pages
|
|
22
|
+
|
|
23
|
+
Uma página é uma página, onde você colocará principalmente (mas não exclusivamente) organismos.
|
|
24
|
+
|
|
25
|
+
### Templates
|
|
26
|
+
|
|
27
|
+
Um template é um layout para ser usado em páginas.
|
|
28
|
+
|
|
29
|
+
## Do not worry!
|
|
30
|
+
|
|
31
|
+
Atomic Design deve ser uma solução, não outro problema. Se você quiser criar um componente e não sabe onde colocá-lo (átomos, moléculas, organismos etc.), não se preocupe, não pense muito, apenas coloque-o em qualquer lugar. Depois de você perceber o que é, apenas mova a pasta do componente para o lugar certo. Tudo irá funcionar por que os componentes são exportados de forma dinâmica em `src/components/index.ts`.
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
1
|
+
import { m as o, w as k, x as j, o as F, b as n, y as m, W as f, z as I, D as w, G as E, H as S, J as R, I as D, K as L } from "./Tooltip.view-DXp_JUAk.js";
|
|
2
|
+
import { useState as _ } from "react";
|
|
3
3
|
import { sg as r } from "sbwb-ds";
|
|
4
4
|
import "sbwb-ds-latest";
|
|
5
|
-
const
|
|
5
|
+
const $ = ({
|
|
6
6
|
width: c = "100%",
|
|
7
7
|
height: a = "fit-content",
|
|
8
8
|
type: e,
|
|
9
9
|
title: l,
|
|
10
10
|
message: t,
|
|
11
11
|
margin: d,
|
|
12
|
-
open:
|
|
12
|
+
open: x = !0,
|
|
13
13
|
onClose: i,
|
|
14
14
|
canClose: h = !0
|
|
15
15
|
}) => {
|
|
16
|
-
var
|
|
17
|
-
const [p, g] =
|
|
16
|
+
var b, u;
|
|
17
|
+
const [p, g] = _(x), s = {
|
|
18
18
|
info: {
|
|
19
19
|
backgroundColor: "#D5EBFD",
|
|
20
20
|
borderColor: r.colors.feedbackColors.colorFeedbackInfo,
|
|
@@ -68,9 +68,9 @@ const v = ({
|
|
|
68
68
|
verticalAlign: l ? "top" : "center",
|
|
69
69
|
gap: r.spacings.spacingInset.spacingInsetXs,
|
|
70
70
|
padding: r.spacings.spacingInline.spacingInlineSm,
|
|
71
|
-
backgroundColor: (
|
|
71
|
+
backgroundColor: (b = s == null ? void 0 : s[e]) == null ? void 0 : b.backgroundColor,
|
|
72
72
|
customStyles: {
|
|
73
|
-
border: `1px solid ${(
|
|
73
|
+
border: `1px solid ${(u = s == null ? void 0 : s[e]) == null ? void 0 : u.borderColor}`,
|
|
74
74
|
borderRadius: r.borders.borderRadius.borderRadiusSm,
|
|
75
75
|
margin: d,
|
|
76
76
|
position: "relative"
|
|
@@ -94,14 +94,14 @@ const v = ({
|
|
|
94
94
|
]
|
|
95
95
|
}
|
|
96
96
|
) : /* @__PURE__ */ o.jsx(o.Fragment, {}) });
|
|
97
|
-
},
|
|
97
|
+
}, q = ({
|
|
98
98
|
label: c,
|
|
99
99
|
labelRender: a,
|
|
100
100
|
infoProps: e = {},
|
|
101
101
|
withInfo: l = !0,
|
|
102
102
|
flex: t,
|
|
103
103
|
width: d = "100%",
|
|
104
|
-
isRequired:
|
|
104
|
+
isRequired: x = !1
|
|
105
105
|
}) => {
|
|
106
106
|
const i = {
|
|
107
107
|
tooltipProps: {
|
|
@@ -114,18 +114,18 @@ const v = ({
|
|
|
114
114
|
a ?? /* @__PURE__ */ o.jsxs(S, { children: [
|
|
115
115
|
c,
|
|
116
116
|
" ",
|
|
117
|
-
|
|
117
|
+
x ? /* @__PURE__ */ o.jsx(R, { children: "*" }) : null
|
|
118
118
|
] }),
|
|
119
|
-
l && /* @__PURE__ */ o.jsx(
|
|
119
|
+
l && /* @__PURE__ */ o.jsx(D, { ...i })
|
|
120
120
|
] });
|
|
121
|
-
},
|
|
121
|
+
}, v = ({
|
|
122
122
|
width: c = "100%",
|
|
123
123
|
flex: a,
|
|
124
124
|
label: e = "Obrigatório",
|
|
125
125
|
margin: l = "0 0 16px 0"
|
|
126
|
-
}) => /* @__PURE__ */ o.jsx(n, { width: c, flex: a, customStyles: { margin: l }, children: /* @__PURE__ */ o.jsx(
|
|
126
|
+
}) => /* @__PURE__ */ o.jsx(n, { width: c, flex: a, customStyles: { margin: l }, children: /* @__PURE__ */ o.jsx(L, { children: `* ${e}` }) });
|
|
127
127
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
128
|
+
$ as A,
|
|
129
|
+
q as L,
|
|
130
|
+
v as R
|
|
131
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const r=require("./Tooltip.view-
|
|
1
|
+
"use strict";const r=require("./Tooltip.view-CoRsYgPx.cjs"),h=require("react"),e=require("sbwb-ds");require("sbwb-ds-latest");const m=({width:n="100%",height:i="fit-content",type:o,title:t,message:c,margin:x,open:a=!0,onClose:l,canClose:p=!0})=>{var d,u;const[j,b]=h.useState(a),s={info:{backgroundColor:"#D5EBFD",borderColor:e.sg.colors.feedbackColors.colorFeedbackInfo,icon:r.jsxRuntimeExports.jsx(r.InfoFill_default,{color:e.sg.colors.feedbackColors.colorFeedbackInfo,height:"20px",width:"20px"})},success:{backgroundColor:"#DAF9DB",borderColor:e.sg.colors.feedbackColors.colorFeedbackSuccess,icon:r.jsxRuntimeExports.jsx(r.CheckCircleFill_default,{color:e.sg.colors.feedbackColors.colorFeedbackSuccess,height:"20px",width:"20px"})},warning:{backgroundColor:"#FEEECF",borderColor:e.sg.colors.feedbackColors.colorFeedbackWarning},error:{backgroundColor:"#FFE1E1",borderColor:e.sg.colors.feedbackColors.colorFeedbackError,icon:r.jsxRuntimeExports.jsx(r.ErrorFill_default,{color:e.sg.colors.feedbackColors.colorFeedbackError,height:"20px",width:"20px"})}};function g(){b(!1),l==null||l()}return r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:j?r.jsxRuntimeExports.jsxs(r.Container,{width:n,height:i,direction:"horizontal",verticalAlign:t?"top":"center",gap:e.sg.spacings.spacingInset.spacingInsetXs,padding:e.sg.spacings.spacingInline.spacingInlineSm,backgroundColor:(d=s==null?void 0:s[o])==null?void 0:d.backgroundColor,customStyles:{border:`1px solid ${(u=s==null?void 0:s[o])==null?void 0:u.borderColor}`,borderRadius:e.sg.borders.borderRadius.borderRadiusSm,margin:x,position:"relative"},children:[o==="warning"?r.jsxRuntimeExports.jsx(r.ContainerWarning,{children:r.jsxRuntimeExports.jsx(r.WarningFill_default,{width:"20px",height:"20px"})}):r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{children:s==null?void 0:s[o].icon}),r.jsxRuntimeExports.jsxs(r.Container,{width:"100%",flex:"1",height:"100%",children:[r.jsxRuntimeExports.jsx(r.Title$1,{children:t}),r.jsxRuntimeExports.jsx(r.Message,{children:c})]}),p&&r.jsxRuntimeExports.jsx(r.Container,{children:r.jsxRuntimeExports.jsx(r.Close_default,{color:e.sg.colors.neutralColors.colorNeutralCloudy,cursor:"pointer",onClick:g,height:"20px",width:"20px"})})]}):r.jsxRuntimeExports.jsx(r.jsxRuntimeExports.Fragment,{})})},E=({label:n,labelRender:i,infoProps:o={},withInfo:t=!0,flex:c,width:x="100%",isRequired:a=!1})=>{const l={tooltipProps:{position:"top",...o==null?void 0:o.tooltipProps,size:"Small"}};return r.jsxRuntimeExports.jsxs(r.Container,{width:x,direction:"horizontal",gap:"4px",flex:c,children:[i??r.jsxRuntimeExports.jsxs(r.Label$1,{children:[n," ",a?r.jsxRuntimeExports.jsx(r.Required,{children:"*"}):null]}),t&&r.jsxRuntimeExports.jsx(r.Info,{...l})]})},R=({width:n="100%",flex:i,label:o="Obrigatório",margin:t="0 0 16px 0"})=>r.jsxRuntimeExports.jsx(r.Container,{width:n,flex:i,customStyles:{margin:t},children:r.jsxRuntimeExports.jsx(r.Label$2,{children:`* ${o}`})});exports.AlertInline=m;exports.LabelField=E;exports.RequiredLabelView=R;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const o=require("./Tooltip.view-
|
|
1
|
+
"use strict";const o=require("./Tooltip.view-CoRsYgPx.cjs"),g=require("react"),t=require("sbwb-ds");require("sbwb-ds-latest");const F=require("./index-BcwQwoIM.cjs"),Q=require("react-hook-form"),ee=350,ae=({title:e,children:n,endAdornment:i=null,marginBottom:s="16px",customStyles:l={},wrapperCustomStyles:c={},animationContainerCustomStyles:a={},hideAdornmentOnCollapse:h=!1,maxHeight:m="none",height:p="fit-content"})=>{const[u,f]=g.useState(!1),[b,E]=g.useState(!0);g.useEffect(()=>{if(h)if(u){const w=setTimeout(()=>E(!1),ee);return()=>clearTimeout(w)}else E(!0)},[u,h]);const x=h&&!b?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:u,setCollapsed:f},endAdornment:x,customStyles:l}),o.jsxRuntimeExports.jsx(o.Container,{gap:"8px",width:"100%",height:p,customStyles:{...a,maxHeight:u?"0":m,transition:`max-height ${ee}ms ease-in-out`},children:n})]})};function Y(e,n,i){var s,l,c,a,h;n==null&&(n=100);function m(){var u=Date.now()-a;u<n&&u>=0?s=setTimeout(m,n-u):(s=null,i||(h=e.apply(c,l),c=l=null))}var p=function(){c=this,l=arguments,a=Date.now();var u=i&&!s;return s||(s=setTimeout(m,n)),u&&(h=e.apply(c,l),c=l=null),h};return p.clear=function(){s&&(clearTimeout(s),s=null)},p.flush=function(){s&&(h=e.apply(c,l),c=l=null,clearTimeout(s),s=null)},p}Y.debounce=Y;var ce=Y;const de=o.getDefaultExportFromCjs(ce);function Z({form:e,fieldName:n,triggerType:i=null,debounceTime:s=500}){const l=g.useCallback(()=>{e.trigger(n)},[e,n]),c=g.useMemo(()=>de(()=>l(),s),[l,s]),a=g.useMemo(()=>["all","onChange"].includes(i)?c:null,[c,i]),h=g.useMemo(()=>["all","onBlur"].includes(i)?l:null,[i]);return g.useMemo(()=>({onChangeTrigger:a,onBlurTrigger:h}),[a,h])}const ge=({form:e,name:n,label:i,options:s,readonly:l=!1,disabled:c=!1,optionsMap:a,width:h="100%",flex:m,placeholder:p,onSelect:u,parser:f,filter:b,tooltipProps:E={},infoProps:x={},maxHeigthMenu:w,isRequired:R=!1,onRemoveSelected:H,triggerFormField:C=null,displayText:W,...v})=>{const{onChangeTrigger:k}=Z({form:e,fieldName:n,triggerType:C,debounceTime:0}),O={position:"top",...E},L={...x,tooltipProps:{position:"top",maxWidth:"300px",...x==null?void 0:x.tooltipProps}},T=(y,I)=>{let A=y;f&&(A=f==null?void 0:f(y)),I(A),u==null||u(A),k==null||k()},$=g.useMemo(()=>F.valuable(a)?a:Object.fromEntries(s.map(y=>[y.value,y])),[s,a]);return o.jsxRuntimeExports.jsx(o.Container,{width:h,flex:m,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:y,value:I},fieldState:{error:A=null}})=>{let j=$[I];return o.jsxRuntimeExports.jsx(K,{label:i,width:"100%",size:"Small",disabled:c,readonly:l,filter:b,errorMessage:A==null?void 0:A.message,placeholder:p,value:j,handleOption:d=>{T(d.value,y)},tooltipProps:O,options:s,maxHeigthMenu:w,infoProps:L,maxHeightMenu:w,isRequired:R,onRemoveSelected:H,displayText:W,...v})}})})},oe=({form:e,name:n,label:i,readonly:s=!1,disabled:l=!1,width:c="100%",height:a="100%",flex:h,placeholder:m,charactersCounter:p=!0,maxlength:u=1e3,resize:f=!0,triggerFormField:b=null,minHeight:E,maxHeight:x,...w})=>{const{onChangeTrigger:R}=Z({form:e,fieldName:n,triggerType:b}),H=(C,W)=>{W(C),R==null||R()};return o.jsxRuntimeExports.jsx(o.Container,{width:c,flex:h,height:a,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:C,value:W},fieldState:{error:v=null}})=>o.jsxRuntimeExports.jsx(o.Textarea,{label:i,value:W||"",width:"100%",disabled:l,readonly:s,height:a,minHeight:E,maxHeight:x,errorMessage:v==null?void 0:v.message,placeholder:m,onChange:k=>H(k.target.value,C),charactersCounter:p,maxlength:u,size:"Small",resize:f,...w})})})};oe.displayName="TextareaField";const ue=({form:e,name:n,id:i=n,label:s,readonly:l=!1,disabled:c=!1,afterCheck:a,width:h="100%",formatter:m,parser:p,flex:u,size:f="Medium",triggerFormField:b=null,...E})=>{const{onChangeTrigger:x}=Z({form:e,fieldName:n,triggerType:b,debounceTime:0}),w=(R,H)=>{H(R),a==null||a(R),x==null||x()};return o.jsxRuntimeExports.jsx(o.Container,{width:h,flex:u,children:o.jsxRuntimeExports.jsx(Q.Controller,{name:n,control:e.control,render:({field:{onChange:R,value:H},fieldState:{error:C=null}})=>{const W=C==null?void 0:C.message;return W&&console.log("Error on checkbox!",W),o.jsxRuntimeExports.jsx(o.Checkbox,{id:`form-checkbox-${i}`,checked:(m==null?void 0:m(H))??H,name:n,label:s,disabled:c||l,onChange:v=>{w((p==null?void 0:p(v.target.checked,H))??v.target.checked,R)},size:f,...E})}})})},fe=o.qe.ul`
|
|
2
2
|
${F.resetStyles}
|
|
3
3
|
position: fixed;
|
|
4
4
|
margin-top: ${({marginTop:e})=>e};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import je, { useState as P, useEffect as Z, useCallback as he, useMemo as
|
|
3
|
-
import { sg as o, Icon as
|
|
1
|
+
import { m as n, b as _, j as ce, N as xe, k as we, C as ye, O as x, P as M, s as Ce, T as fe, S as ke, I as ze, Q as Be, E as ue } from "./Tooltip.view-DXp_JUAk.js";
|
|
2
|
+
import je, { useState as P, useEffect as Z, useCallback as he, useMemo as Y, useRef as U, forwardRef as ge, isValidElement as se, useLayoutEffect as Ne } from "react";
|
|
3
|
+
import { sg as o, Icon as V } from "sbwb-ds";
|
|
4
4
|
import "sbwb-ds-latest";
|
|
5
5
|
import { v as G, r as q, b as We } from "./index-_v6RoRxb.js";
|
|
6
6
|
import { Controller as re } from "react-hook-form";
|
|
@@ -99,17 +99,17 @@ function le({
|
|
|
99
99
|
}) {
|
|
100
100
|
const s = he(() => {
|
|
101
101
|
e.trigger(t);
|
|
102
|
-
}, [e, t]), d =
|
|
102
|
+
}, [e, t]), d = Y(
|
|
103
103
|
() => ve(() => s(), l),
|
|
104
104
|
[s, l]
|
|
105
|
-
), a =
|
|
105
|
+
), a = Y(
|
|
106
106
|
() => ["all", "onChange"].includes(i) ? d : null,
|
|
107
107
|
[d, i]
|
|
108
|
-
), h =
|
|
108
|
+
), h = Y(
|
|
109
109
|
() => ["all", "onBlur"].includes(i) ? s : null,
|
|
110
110
|
[i]
|
|
111
111
|
);
|
|
112
|
-
return
|
|
112
|
+
return Y(
|
|
113
113
|
() => ({
|
|
114
114
|
onChangeTrigger: a,
|
|
115
115
|
onBlurTrigger: h
|
|
@@ -158,7 +158,7 @@ const Co = ({
|
|
|
158
158
|
}, T = (y, v) => {
|
|
159
159
|
let E = y;
|
|
160
160
|
u && (E = u == null ? void 0 : u(y)), v(E), f == null || f(E), B == null || B();
|
|
161
|
-
}, b =
|
|
161
|
+
}, b = Y(() => G(a) ? a : Object.fromEntries(l.map((y) => [y.value, y])), [l, a]);
|
|
162
162
|
return /* @__PURE__ */ n.jsx(_, { width: h, flex: m, children: /* @__PURE__ */ n.jsx(
|
|
163
163
|
re,
|
|
164
164
|
{
|
|
@@ -541,7 +541,7 @@ const ko = ({
|
|
|
541
541
|
iconPosition: (I = r.tooltipProps) == null ? void 0 : I.position,
|
|
542
542
|
id: `iconContainer-${r.value}`,
|
|
543
543
|
children: /* @__PURE__ */ n.jsx(
|
|
544
|
-
|
|
544
|
+
V,
|
|
545
545
|
{
|
|
546
546
|
iconName: W,
|
|
547
547
|
color: r.disabled ? o.colors.neutralColors.colorNeutralCleanest : y(r) ? o.colors.brandColors.colorBrandSoft : $ ?? o.colors.neutralColors.colorNeutralDark
|
|
@@ -701,7 +701,7 @@ const Oe = ({
|
|
|
701
701
|
t ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
702
702
|
/* @__PURE__ */ n.jsx(ke, { size: "auto", direction: "horizontal" }),
|
|
703
703
|
/* @__PURE__ */ n.jsx(
|
|
704
|
-
|
|
704
|
+
V,
|
|
705
705
|
{
|
|
706
706
|
iconName: t,
|
|
707
707
|
onClick: () => i == null ? void 0 : i(),
|
|
@@ -852,7 +852,7 @@ const Xe = x.div`
|
|
|
852
852
|
o.fonts.fontSize.fontSizeBodyMd
|
|
853
853
|
)};
|
|
854
854
|
color: ${o.colors.neutralColors.colorNeutralDark};
|
|
855
|
-
`,
|
|
855
|
+
`, Ye = x.label`
|
|
856
856
|
font-family: ${o.fonts.fontFamily.fontFamilyPrimary};
|
|
857
857
|
font-size: ${o.fonts.fontSize.fontSizeBodyMd};
|
|
858
858
|
font-weight: ${o.fonts.fontWeight.fontWeightRegular};
|
|
@@ -869,7 +869,7 @@ x.p`
|
|
|
869
869
|
margin-top: ${o.spacings.spacingInline.spacingInlineNano};
|
|
870
870
|
width: 100%;
|
|
871
871
|
`;
|
|
872
|
-
const
|
|
872
|
+
const Ve = x.p`
|
|
873
873
|
display: inline-block;
|
|
874
874
|
font-size: ${({ size: e }) => e === "Small" ? o.fonts.fontSize.fontSizeBodySm : o.fonts.fontSize.fontSizeBodyMd};
|
|
875
875
|
font-weight: ${o.fonts.fontWeight.fontWeightRegular};
|
|
@@ -968,14 +968,14 @@ const Ye = x.p`
|
|
|
968
968
|
...z,
|
|
969
969
|
size: a
|
|
970
970
|
}, K = /* @__PURE__ */ n.jsx(
|
|
971
|
-
|
|
971
|
+
V,
|
|
972
972
|
{
|
|
973
973
|
iconName: `Close${a === "Small" ? "Sm" : "Ant"}`,
|
|
974
974
|
onClick: (Q) => {
|
|
975
975
|
Q.stopPropagation(), R(e);
|
|
976
976
|
}
|
|
977
977
|
}
|
|
978
|
-
), te = /* @__PURE__ */ n.jsx(
|
|
978
|
+
), te = /* @__PURE__ */ n.jsx(V, { iconName: `ExpandLess${a === "Small" ? "Sm" : "Ant"}` }), be = /* @__PURE__ */ n.jsx(V, { iconName: `ExpandMore${a === "Small" ? "Sm" : "Ant"}` });
|
|
979
979
|
return /* @__PURE__ */ n.jsxs(
|
|
980
980
|
Xe,
|
|
981
981
|
{
|
|
@@ -988,7 +988,7 @@ const Ye = x.p`
|
|
|
988
988
|
d && /* @__PURE__ */ n.jsxs(Je, { children: [
|
|
989
989
|
/* @__PURE__ */ n.jsxs(Qe, { "data-testid": "label", ref: J, children: [
|
|
990
990
|
d,
|
|
991
|
-
k && !m ? /* @__PURE__ */ n.jsx(
|
|
991
|
+
k && !m ? /* @__PURE__ */ n.jsx(Ye, { children: " *" }) : null
|
|
992
992
|
] }),
|
|
993
993
|
((D == null ? void 0 : D.message) || (D == null ? void 0 : D.render)) && /* @__PURE__ */ n.jsx(ze, { ...D })
|
|
994
994
|
] }),
|
|
@@ -1057,7 +1057,7 @@ const Ye = x.p`
|
|
|
1057
1057
|
]
|
|
1058
1058
|
}
|
|
1059
1059
|
) }),
|
|
1060
|
-
p && /* @__PURE__ */ n.jsx(
|
|
1060
|
+
p && /* @__PURE__ */ n.jsx(Ve, { size: a, children: p })
|
|
1061
1061
|
]
|
|
1062
1062
|
}
|
|
1063
1063
|
);
|
|
@@ -1250,7 +1250,7 @@ const to = x.div`
|
|
|
1250
1250
|
id: `button-component-${e}`,
|
|
1251
1251
|
children: [
|
|
1252
1252
|
d && /* @__PURE__ */ n.jsx(to, { size: l, disabled: s, variant: t, children: /* @__PURE__ */ n.jsx(
|
|
1253
|
-
|
|
1253
|
+
V,
|
|
1254
1254
|
{
|
|
1255
1255
|
iconName: `ProgressActivity${l === "Small" ? "Ant" : "Sm"}`,
|
|
1256
1256
|
color: z,
|
|
@@ -1259,14 +1259,14 @@ const to = x.div`
|
|
|
1259
1259
|
) }),
|
|
1260
1260
|
!d && /* @__PURE__ */ n.jsx("p", { title: e, children: e }),
|
|
1261
1261
|
!d && ($ ? /* @__PURE__ */ n.jsx(
|
|
1262
|
-
|
|
1262
|
+
V,
|
|
1263
1263
|
{
|
|
1264
1264
|
iconName: `ExpandLess${l === "Small" ? "Ant" : "Sm"}`,
|
|
1265
1265
|
color: z,
|
|
1266
1266
|
"data-testid": "icon-button-less"
|
|
1267
1267
|
}
|
|
1268
1268
|
) : /* @__PURE__ */ n.jsx(
|
|
1269
|
-
|
|
1269
|
+
V,
|
|
1270
1270
|
{
|
|
1271
1271
|
iconName: `ExpandMore${l === "Small" ? "Ant" : "Sm"}`,
|
|
1272
1272
|
color: z,
|
|
@@ -1614,7 +1614,7 @@ function jo({
|
|
|
1614
1614
|
striped: g = !1,
|
|
1615
1615
|
borderRadius: w = o.borders.borderRadius.borderRadiusSm
|
|
1616
1616
|
}) {
|
|
1617
|
-
const z =
|
|
1617
|
+
const z = Y(() => mo(t), [t]), [L, k] = P(null), R = U(null), H = U(null), [B, J] = P(a);
|
|
1618
1618
|
Ne(() => {
|
|
1619
1619
|
if (!H.current || a.length === 0) {
|
|
1620
1620
|
J(a);
|
|
@@ -1672,9 +1672,9 @@ function jo({
|
|
|
1672
1672
|
document.removeEventListener("mousedown", b);
|
|
1673
1673
|
};
|
|
1674
1674
|
}, []);
|
|
1675
|
-
const A =
|
|
1675
|
+
const A = Y(() => B ? B.some(
|
|
1676
1676
|
(b) => b.mergeHeaderId && b.mergeHeaderLabel
|
|
1677
|
-
) : !1, [B]), T =
|
|
1677
|
+
) : !1, [B]), T = Y(() => {
|
|
1678
1678
|
var E, C;
|
|
1679
1679
|
if (u || !B || B.length === 0)
|
|
1680
1680
|
return null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("./Tooltip.view-CoRsYgPx.cjs"),j=require("sbwb-ds"),a=require("react"),h=require("./index-BcwQwoIM.cjs"),p=({message:e})=>t.jsxRuntimeExports.jsxs(t.ErrorMessage,{children:[t.jsxRuntimeExports.jsx(t.InfoFill_default,{color:j.sg.colors.feedbackColors.colorFeedbackError}),e]}),w=({id:e,label:c,size:o="Medium",disabled:r=!1,onChange:x,checked:s})=>{const[n,u]=a.useState(s??!1);return a.useEffect(()=>{u(i=>s??!i)},[s]),t.jsxRuntimeExports.jsxs(t.SwitchContainer,{id:`switch-${e}`,"data-testid":"switch-component",children:[t.jsxRuntimeExports.jsxs(t.SwitchWrapper,{size:o,disabled:r,checked:s??n,"data-testid":"switch-wrapper",children:[t.jsxRuntimeExports.jsx(t.SwitchToggle,{type:"checkbox",disabled:r,checked:s??n,"data-testid":"switch-toggle",onChange:i=>{const{target:{checked:l}}=i;h.valuable(l)&&u(l),x==null||x(i)}}),t.jsxRuntimeExports.jsx(t.SwitchButton,{disabled:r,size:o})]}),t.jsxRuntimeExports.jsx(t.SwitchLabel,{size:o,disabled:r,children:c})]})},E=({text:e,color:c})=>t.jsxRuntimeExports.jsx(t.Title,{color:c,children:e});exports.ErrorMessage=p;exports.Switch=w;exports.Title=E;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { m as t, n as p, o as f, p as m, q as u, r as x, t as d, u as w, v as S } from "./Tooltip.view-DXp_JUAk.js";
|
|
2
|
+
import { sg as j } from "sbwb-ds";
|
|
3
|
+
import { useState as E, useEffect as g } from "react";
|
|
4
|
+
import { v as k } from "./index-_v6RoRxb.js";
|
|
5
|
+
const b = ({ message: s }) => /* @__PURE__ */ t.jsxs(p, { children: [
|
|
6
|
+
/* @__PURE__ */ t.jsx(f, { color: j.colors.feedbackColors.colorFeedbackError }),
|
|
7
|
+
s
|
|
8
|
+
] }), F = ({
|
|
9
|
+
id: s,
|
|
10
|
+
label: a,
|
|
11
|
+
size: c = "Medium",
|
|
12
|
+
disabled: e = !1,
|
|
13
|
+
onChange: i,
|
|
14
|
+
checked: r
|
|
15
|
+
}) => {
|
|
16
|
+
const [l, h] = E(r ?? !1);
|
|
17
|
+
return g(() => {
|
|
18
|
+
h((o) => r ?? !o);
|
|
19
|
+
}, [r]), /* @__PURE__ */ t.jsxs(m, { id: `switch-${s}`, "data-testid": "switch-component", children: [
|
|
20
|
+
/* @__PURE__ */ t.jsxs(
|
|
21
|
+
u,
|
|
22
|
+
{
|
|
23
|
+
size: c,
|
|
24
|
+
disabled: e,
|
|
25
|
+
checked: r ?? l,
|
|
26
|
+
"data-testid": "switch-wrapper",
|
|
27
|
+
children: [
|
|
28
|
+
/* @__PURE__ */ t.jsx(
|
|
29
|
+
x,
|
|
30
|
+
{
|
|
31
|
+
type: "checkbox",
|
|
32
|
+
disabled: e,
|
|
33
|
+
checked: r ?? l,
|
|
34
|
+
"data-testid": "switch-toggle",
|
|
35
|
+
onChange: (o) => {
|
|
36
|
+
const {
|
|
37
|
+
target: { checked: n }
|
|
38
|
+
} = o;
|
|
39
|
+
k(n) && h(n), i == null || i(o);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
),
|
|
43
|
+
/* @__PURE__ */ t.jsx(d, { disabled: e, size: c })
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
),
|
|
47
|
+
/* @__PURE__ */ t.jsx(w, { size: c, disabled: e, children: a })
|
|
48
|
+
] });
|
|
49
|
+
}, q = ({ text: s, color: a }) => /* @__PURE__ */ t.jsx(S, { color: a, children: s });
|
|
50
|
+
export {
|
|
51
|
+
b as E,
|
|
52
|
+
F as S,
|
|
53
|
+
q as T
|
|
54
|
+
};
|