sbwb-ds 0.0.3 → 0.0.4

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/dist/atoms.cjs ADDED
@@ -0,0 +1,19 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./styles-c5a8b30d.cjs"),f=require("react");function Y(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const o in e)if(o!=="default"){const r=Object.getOwnPropertyDescriptor(e,o);Object.defineProperty(t,o,r.get?r:{enumerable:!0,get:()=>e[o]})}}return t.default=e,Object.freeze(t)}const p=Y(f),K=()=>{const e=f.useRef(null),[t,o]=f.useState();return f.useEffect(()=>{const r=()=>{if(e.current){const a=e.current.getBoundingClientRect().width;o(a)}};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),{containerRef:e,widthContainer:t}},Q=({children:e,custom:t,backgroundColor:o,scrollVertical:r,scrollHorizontal:a,type:s="platform",templateRows:i})=>{const{containerRef:l,widthContainer:c}=K();return n.jsx(n.ContainerWrapper,{ref:l,"data-testid":"container",styles:t,backgroundColor:o,scrollHorizontal:a,scrollVertical:r,type:s,templateRows:i,widthContainer:c,children:e})},X=()=>{const e=f.useRef(null),[t,o]=f.useState();return f.useEffect(()=>{const r=()=>{if(e.current){const a=e.current.getBoundingClientRect().width;o(a)}};return r(),window.addEventListener("resize",r),()=>{window.removeEventListener("resize",r)}},[]),{GridAreaRef:e,widthGridArea:t}},Z=({children:e,custom:t,backgroundColor:o,scrollVertical:r,scrollHorizontal:a,type:s="platform",templateRows:i,gridRow:l,gridColumn:c})=>{const{GridAreaRef:u,widthGridArea:d}=X();return n.jsx(n.ContainerWrapper$1,{ref:u,"data-testid":"container",styles:t,backgroundColor:o,scrollHorizontal:a,scrollVertical:r,type:s,templateRows:i,widthGridArea:d,gridRow:l,gridColumn:c,children:e})},H=({height:e,width:t,padding:o,margin:r,backgroundColor:a,children:s,alignItems:i="start",justifyContent:l="start",gap:c,gridRow:u,gridColumn:d})=>n.jsx(n.Row,{height:e,width:t,padding:o,backgroundColor:a,alignItems:i,justifyContent:l,margin:r,"data-testid":"row",id:"row",gap:c,gridRow:u,gridColumn:d,children:s}),ee=({height:e,width:t,backgroundColor:o,padding:r,children:a,alignItems:s,justifyContent:i,margin:l,gap:c})=>n.jsx(n.Column,{height:e,width:t,backgroundColor:o,padding:r,alignItems:s,justifyContent:i,margin:l,"data-testid":"column",id:"column",gap:c,children:a}),te=({onChange:e,currentPage:t,numberOfPages:o,numberOfOptions:r,itemsPerPage:a})=>{const[s,i]=f.useState(0),[l,c]=f.useState(0),[u,d]=f.useState(),[g,v]=f.useState([]);f.useEffect(()=>{i(t)},[t]),f.useEffect(()=>{c(o)},[o]);const x=()=>{let h=[],q=s<Math.round(r/2),z=s>l-Math.floor(r/2)-1;if(q)h=new Array(l>r?r:l).fill(0),h=h.map((E,j)=>j+1),r>=4&&r<l&&l>4&&(h[h.length-1]="...",h.push(l));else if(z){h=new Array(l>r?r:l).fill(0);let E=new Array(l).fill(0);if(E=E.map((j,S)=>S+1),E.reverse(),h=h.map((j,S)=>E[S]),h.reverse(),r>=4&&r<l&&l>4){let j=[...h];h=[1,"..."];for(let S=1;S<j.length;S++)h.push(j[S])}}else{const E=Math.max(1,s-Math.floor(r/2)),j=Math.min(l,E+r-1);for(let S=E;S<=j;S++)h.push(S);h[h.length-1]="...",h.push(l),h.reverse(),h[h.length-1]!==1&&(h[h.length-1]="...",h.push(1)),h.reverse()}v(h)};f.useEffect(()=>{x()},[l,s]),f.useEffect(()=>{d(a)},[a]);const C=h=>{i(h),e({numberOfPages:l,itemsPerPage:u,currentPage:h})},y=n.Icons.ChevronLeftAnt,V=n.Icons.ChevronRightAnt;return{pages:g,ChevronLeft:y,ChevronRight:V,pageChange:C,currentPageState:s,numberOfPagesState:l}},ne=({currentPage:e,onChange:t,itemsPerPage:o=10,numberOfPages:r=1,numberOfOptions:a=5,size:s="Large",horizontalAlign:i="flex-end"})=>{const{ChevronLeft:l,ChevronRight:c,pageChange:u,pages:d,currentPageState:g,numberOfPagesState:v}=te({onChange:t,currentPage:e,numberOfPages:r,numberOfOptions:a,itemsPerPage:o});return n.jsx(n.Flex,{size:s,horizontalAlign:i,children:r>1?n.jsxs(n.Container,{children:[n.jsx(n.Item,{onClick:()=>{g>1&&u(g-1)},disabled:g===1,isIcon:!0,size:s,"data-testid":"previous",children:n.jsx(l,{})}),n.jsx(n.PageContainer,{children:d.map((x,C)=>n.jsx(f.Fragment,{children:x==="..."?n.jsx(n.Item,{noHover:!0,size:s,children:x}):n.jsx(n.Item,{active:x===g,onClick:()=>{u(x)},size:s,"data-testid":"item",children:x})},`${x}-${C}`))}),n.jsx(n.Item,{onClick:()=>{g<v&&u(g+1)},disabled:g>=v,isIcon:!0,size:s,"data-testid":"next",children:n.jsx(c,{})})]}):null})},oe=({width:e="100%",itemTitle:t,isSelected:o=!1,disabled:r=!1,size:a="Medium",description:s,onClick:i})=>n.jsxs(n.Container$1,{width:e,isSelected:o,disabled:r,size:a,hasDescription:!!s,onClick:!r&&i,children:[n.jsx(n.Title,{isSelected:o,disabled:r,size:a,title:t,children:t}),s&&n.jsx(n.Description,{disabled:r,size:a,title:s,children:s})]});class M{set(t,o){o?typeof o=="string"?localStorage.setItem(t,o):localStorage.setItem(t,JSON.stringify(o)):localStorage.removeItem(t)}get(t){const o=localStorage.getItem(t);let r;try{r=JSON.parse(o)}catch{r=o}finally{return r}}remove(t){localStorage.removeItem(t)}}/**
2
+ * @remix-run/router v1.7.2
3
+ *
4
+ * Copyright (c) Remix Software Inc.
5
+ *
6
+ * This source code is licensed under the MIT license found in the
7
+ * LICENSE.md file in the root directory of this source tree.
8
+ *
9
+ * @license MIT
10
+ */function L(){return L=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},L.apply(this,arguments)}var F;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(F||(F={}));function m(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function O(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function _(e){let t={};if(e){let o=e.indexOf("#");o>=0&&(t.hash=e.substr(o),e=e.substr(0,o));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}var k;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(k||(k={}));function re(e,t){t===void 0&&(t="/");let{pathname:o,search:r="",hash:a=""}=typeof e=="string"?_(e):e;return{pathname:o?o.startsWith("/")?o:ae(o,t):t,search:ce(r),hash:ue(a)}}function ae(e,t){let o=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?o.length>1&&o.pop():a!=="."&&o.push(a)}),o.length>1?o.join("/"):"/"}function N(e,t,o,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+o+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function se(e){return e.filter((t,o)=>o===0||t.route.path&&t.route.path.length>0)}function ie(e,t,o,r){r===void 0&&(r=!1);let a;typeof e=="string"?a=_(e):(a=L({},e),m(!a.pathname||!a.pathname.includes("?"),N("?","pathname","search",a)),m(!a.pathname||!a.pathname.includes("#"),N("#","pathname","hash",a)),m(!a.search||!a.search.includes("#"),N("#","search","hash",a)));let s=e===""||a.pathname==="",i=s?"/":a.pathname,l;if(r||i==null)l=o;else{let g=t.length-1;if(i.startsWith("..")){let v=i.split("/");for(;v[0]==="..";)v.shift(),g-=1;a.pathname=v.join("/")}l=g>=0?t[g]:"/"}let c=re(a,l),u=i&&i!=="/"&&i.endsWith("/"),d=(s||i===".")&&o.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const le=e=>e.join("/").replace(/\/\/+/g,"/"),ce=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,ue=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,W=["post","put","patch","delete"];new Set(W);const de=["get",...W];new Set(de);/**
11
+ * React Router v6.14.2
12
+ *
13
+ * Copyright (c) Remix Software Inc.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE.md file in the root directory of this source tree.
17
+ *
18
+ * @license MIT
19
+ */function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var r in o)Object.prototype.hasOwnProperty.call(o,r)&&(e[r]=o[r])}return e},P.apply(this,arguments)}const w=p.createContext(null);process.env.NODE_ENV!=="production"&&(w.displayName="DataRouter");const he=p.createContext(null);process.env.NODE_ENV!=="production"&&(he.displayName="DataRouterState");const fe=p.createContext(null);process.env.NODE_ENV!=="production"&&(fe.displayName="Await");const b=p.createContext(null);process.env.NODE_ENV!=="production"&&(b.displayName="Navigation");const D=p.createContext(null);process.env.NODE_ENV!=="production"&&(D.displayName="Location");const R=p.createContext({outlet:null,matches:[],isDataRoute:!1});process.env.NODE_ENV!=="production"&&(R.displayName="Route");const ge=p.createContext(null);process.env.NODE_ENV!=="production"&&(ge.displayName="RouteError");function U(){return p.useContext(D)!=null}function pe(){return U()||(process.env.NODE_ENV!=="production"?m(!1,"useLocation() may be used only in the context of a <Router> component."):m(!1)),p.useContext(D).location}const T="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function G(e){p.useContext(b).static||p.useLayoutEffect(e)}function Ce(){let{isDataRoute:e}=p.useContext(R);return e?Ee():ve()}function ve(){U()||(process.env.NODE_ENV!=="production"?m(!1,"useNavigate() may be used only in the context of a <Router> component."):m(!1));let e=p.useContext(w),{basename:t,navigator:o}=p.useContext(b),{matches:r}=p.useContext(R),{pathname:a}=pe(),s=JSON.stringify(se(r).map(c=>c.pathnameBase)),i=p.useRef(!1);return G(()=>{i.current=!0}),p.useCallback(function(c,u){if(u===void 0&&(u={}),process.env.NODE_ENV!=="production"&&O(i.current,T),!i.current)return;if(typeof c=="number"){o.go(c);return}let d=ie(c,JSON.parse(s),a,u.relative==="path");e==null&&t!=="/"&&(d.pathname=d.pathname==="/"?t:le([t,d.pathname])),(u.replace?o.replace:o.push)(d,u.state,u)},[t,o,s,a,e])}var I;(function(e){e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate"})(I||(I={}));var A;(function(e){e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId"})(A||(A={}));function J(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function me(e){let t=p.useContext(w);return t||(process.env.NODE_ENV!=="production"?m(!1,J(e)):m(!1)),t}function xe(e){let t=p.useContext(R);return t||(process.env.NODE_ENV!=="production"?m(!1,J(e)):m(!1)),t}function Se(e){let t=xe(e),o=t.matches[t.matches.length-1];return o.route.id||(process.env.NODE_ENV!=="production"?m(!1,e+' can only be used on routes that contain a unique "id"'):m(!1)),o.route.id}function Ee(){let{router:e}=me(I.UseNavigateStable),t=Se(A.UseNavigateStable),o=p.useRef(!1);return G(()=>{o.current=!0}),p.useCallback(function(a,s){s===void 0&&(s={}),process.env.NODE_ENV!=="production"&&O(o.current,T),o.current&&(typeof a=="number"?e.navigate(a):e.navigate(a,P({fromRouteId:t},s)))},[e,t])}var $;(function(e){e[e.pending=0]="pending",e[e.success=1]="success",e[e.error=2]="error"})($||($={}));new Promise(()=>{});const je=()=>{const e=Ce(),[t,o]=f.useState(new M().get("visitedItems")||[]);return{handleRouter:a=>{t.includes(a)||(o([...t,a]),new M().set("visitedItems",[...t,a])),e(a)},visitedItems:t}},ye=({items:e,width:t="100%"})=>{const{handleRouter:o,visitedItems:r}=je(),a=n.Icons.ChevronRightSm;return n.jsx(n.Container$2,{width:t,id:"breadcrumb",children:n.jsx(n.List,{children:e==null?void 0:e.map((s,i,l)=>n.jsxs(f.Fragment,{children:[n.jsx(n.Item$1,{onClick:()=>l.length-1!==i&&o(s.path),lastItem:l.length-1===i,visitedItem:r==null?void 0:r.includes(s.path),children:s.name}),l.length-1===i?"":n.jsx(a,{})]},s.name))})})},Re=({numberSelectedStar:e,numberStar:t,size:o})=>{const[r,a]=f.useState(null),[s,i]=f.useState(e),l=o==="Large"?n.Icons.StarFill1Ant:n.Icons.StarFill1Sm,c=o==="Large"?n.Icons.StarFill0Ant:n.Icons.StarFill0Sm,u=C=>{a(C)},d=()=>{a(null)},g=C=>{i(C)},v=f.useMemo(()=>{const C=[];for(let y=1;y<=t;y++)C.push(y);return C},[t]);return{hoverSelectedStar:r,selectedStar:s,StartFill1:l,StartFill0:c,handleMouseEnter:u,handleMouseLeave:d,handleClick:g,options:v,starToCompare:r??s}},Ne=({numberStar:e=4,numberSelectedStar:t,size:o="Large"})=>{const{StartFill1:r,StartFill0:a,handleMouseEnter:s,handleMouseLeave:i,handleClick:l,options:c,starToCompare:u}=Re({numberSelectedStar:t,numberStar:e,size:o});return n.jsx(n.ContainerActions,{onBlur:i,size:o,"data-testid":"container-actions",children:c.map(d=>n.jsx("div",{onMouseEnter:()=>s(d),onMouseLeave:i,onClick:()=>l(d),"data-testid":"option",children:u!==null&&d<=u?n.jsx(a,{"data-testid":"filled"}):n.jsx(r,{"data-testid":"not filled"})},d))})},Le=({name:e,color:t=n.sg.colors.neutralColors.colorNeutralCleanest,size:o="Large"})=>{const r=o==="Large"?n.Icons.FiberManualRecordFill1Ant:n.Icons.FiberManualRecordFill1Sm;return n.jsxs(n.ContainerStatus,{color:t,size:o,"data-testid":"Container-Status",children:[n.jsx(r,{}),n.jsx("p",{children:e})]})},Pe=(e,t,o,r,a,s)=>{const[i,l]=f.useState(e),c=f.useRef(null);f.useEffect(()=>{l(e)},[e]);const u=n.Icons[`Close${a==="Medium"?"Ant":"Sm"}`],d=n.Icons[`${s}${a==="Medium"?"Ant":"Sm"}`];return{check:i,handleContainerClick:()=>{!t&&c.current&&c.current.click()},handleLabelClick:C=>{C.preventDefault(),C.stopPropagation(),t||l(!i),o&&o(C)},handleLabelClose:C=>{C.preventDefault(),C.stopPropagation(),!t&&r&&r(C)},Close:u,labelRef:c,Icon:d}},Ie=({label:e,closeButton:t,onClose:o,onClick:r,disabled:a,selected:s=!1,size:i="Medium",iconName:l})=>{const{Close:c,check:u,handleContainerClick:d,handleLabelClick:g,handleLabelClose:v,labelRef:x,Icon:C}=Pe(s,a,r,o,i,l);return n.jsxs(n.ContainerTag,{disabled:a,selected:u,size:i,onClick:d,"data-testid":"container-tag",children:[l&&n.jsx(C,{}),n.jsx(n.Label,{ref:x,htmlFor:!a&&`tag-${e}`,disabled:a,size:i,onClick:a?void 0:g,children:e}),t&&n.jsx(c,{onClick:a?void 0:v,"data-testid":"close-button"})]})},B=({id:e,size:t="Small",type:o,variant:r,disabled:a,onClick:s})=>{let i;(c=>{c.copy="ContentPasteFill1",c.edit="Edit",c.delete="CancelFill0",c.loading="Loading",c.save="Save",c.settings="SettingsFill0",c.question="HelpFill0",c.add="Add",c.reload="Sync",c.prev="ChevronLeft",c.next="ChevronRight"})(i||(i={}));const l=n.Icons[`${i[r]}Ant`];return n.jsx(n.ActionButton,{isLoading:r==="loading",id:`actionbutton-${e}`,type:o,onClick:s,size:t,disabled:a,"data-testid":"action-button",children:n.jsx(l,{"data-testid":"action-icon"})})},Ae=(e,t,o)=>{const[r,a]=f.useState(t),s=()=>{a(t)};return f.useEffect(s,[t]),{title:e,seriesName:o,chartData:r,setChartData:a,getData:s}},we=({id:e,title:t,description:o,data:r,seriesName:a,prevChart:s,nextChart:i})=>{const l=n.Icons.SyncSm,{chartData:c,getData:u}=Ae(t,r,a);return f.useEffect(()=>{const d=n.init(document.getElementById("pie-chart")),g={title:{text:t,left:-4,textStyle:{color:n.sg.colors.neutralColors.colorNeutralDarkest,fontFamily:n.sg.fonts.fontFamily.fontFamilyPrimary,fontSize:n.sg.fonts.fontSize.fontSizeTitleMd,fontWeight:n.sg.fonts.fontWeight.fontWeightSemiBold,lineHeight:22},marginBottom:10},tooltip:{show:!1},animation:!1,legend:{orient:"vertical",bottom:0,left:0,data:[...c],icon:"circle",height:74,itemGap:16},series:[{name:a,type:"pie",radius:"40%",center:["50%","50%"],data:c,emphasis:!1,label:!1,color:[`${n.sg.colors.auxiliariesColors.colorAuxOneDark}`,`${n.sg.colors.auxiliariesColors.colorAuxOneLight}`,`${n.sg.colors.auxiliariesColors.colorAuxTwoDark}`,`${n.sg.colors.auxiliariesColors.colorAuxTwoLight}`,`${n.sg.colors.auxiliariesColors.colorAuxThreeDark}`,`${n.sg.colors.auxiliariesColors.colorAuxThreeLight}`,`${n.sg.colors.auxiliariesColors.colorAuxFourDark}`,`${n.sg.colors.auxiliariesColors.colorAuxFourLight}`,`${n.sg.colors.auxiliariesColors.colorAuxFiveDark}`,`${n.sg.colors.auxiliariesColors.colorAuxFiveLight}`]}]};return d.setOption(g),()=>{d.dispose()}},[]),n.jsxs(n.ChartDom,{id:e,"data-testid":"chart-pie",children:[n.jsx("div",{id:"pie-chart",style:{width:"100%",height:"431px"}}),n.jsxs(n.ChartInfo,{"data-testid":"chart-pie-description",children:[o,n.jsxs("div",{children:[s&&n.jsx(B,{variant:"prev",size:"Small","data-testid":"prev-button",id:"prev",onClick:s}),i&&n.jsx(B,{variant:"next",size:"Small","data-testid":"next-button",id:"next",onClick:i})]})]}),n.jsxs(n.RefreshButton,{onClick:u,"data-testid":"reload-button",children:[n.jsx(l,{})," Atualizar"]})]})},be=({iconName:e,stroke:t,width:o="40px",height:r="40px",borderColor:a,onClick:s,noChanges:i=!1,backgroundColor:l,custom:c,title:u})=>{const d=n.Icons[e],g={iconName:e,width:o,height:r,borderColor:a},v=a||"currentColor";return n.jsx(n.IconWrapper,{...g,backgroundColor:l,borderColor:v,onClick:s,noChanges:i,stroke:t,title:u,children:d&&n.jsx(d,{style:c,"data-testid":"icon"})})};exports.Autocomplete=n.Autocomplete;exports.Button=n.Button;exports.Checkbox=n.Checkbox;exports.MenuSelect=n.MenuSelect;exports.Radio=n.Radio;exports.Select=n.Select;exports.Actions=Ne;exports.Breadcrumb=ye;exports.ChartPie=we;exports.Column=ee;exports.Container=Q;exports.GridArea=Z;exports.Icon=be;exports.ItemList=oe;exports.Pagination=ne;exports.Row=H;exports.Status=Le;exports.Tag=Ie;