Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@rdsaude/pulso-react-components

Package Overview
Dependencies
Maintainers
0
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@rdsaude/pulso-react-components - npm Package Compare versions

Comparing version 1.2.0 to 1.3.0-alpha.0

53

dist/index.d.ts

@@ -304,2 +304,53 @@ import * as react_jsx_runtime from 'react/jsx-runtime';

export { Button, type ButtonProps, Icon, InputText, type InputTextProps, Refresh, type TIconProps, type TRefreshProps, ThemeContext, ThemeProvider };
/**
* Representa as props do componente Pagination
*/
interface PaginationProps {
/**
* Define a página atual
*/
current?: number;
/**
* Define a ação do botão de página antegior
*/
prevControl?: PaginationControl;
/**
* Define a ação do botão de próxima página
*/
nextControl?: PaginationControl;
/**
* Define a ação ao clicar em uma página
*/
onPageClick?: () => void;
/**
* Define as páginas possíveis
*/
pagesMapper?: PageMapper[];
/**
* Número total de páginas
*/
total?: number;
}
/**
* Representa a ações de controle
*/
interface PaginationControl {
/**
* Representa o atributo href da tag a do html
*/
href: string;
/**
* Define a função acionada no click do botão
*/
onClickEvent?: () => void;
}
/**
* Representa o mapeamento de páginas possiveis
*/
interface PageMapper {
href: string;
}
declare const Pagination: ({ current, total, pagesMapper, onPageClick, prevControl, nextControl, }: PaginationProps) => react_jsx_runtime.JSX.Element;
export { Button, type ButtonProps, Icon, InputText, type InputTextProps, Pagination, type PaginationProps, Refresh, type TIconProps, type TRefreshProps, ThemeContext, ThemeProvider };

10

dist/index.js

@@ -1,2 +0,2 @@

var se=Object.defineProperty,ae=Object.defineProperties;var le=Object.getOwnPropertyDescriptors;var b=Object.getOwnPropertySymbols;var A=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;var O=(e,t,r)=>t in e?se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,l=(e,t)=>{for(var r in t||(t={}))A.call(t,r)&&O(e,r,t[r]);if(b)for(var r of b(t))E.call(t,r)&&O(e,r,t[r]);return e},i=(e,t)=>ae(e,le(t));var u=(e,t)=>{var r={};for(var o in e)A.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&b)for(var o of b(e))t.indexOf(o)<0&&E.call(e,o)&&(r[o]=e[o]);return r};import{createContext as ie,useEffect as pe}from"react";import{jsx as de}from"react/jsx-runtime";var C=ie({});function De({children:e,theme:t}){return pe(()=>{var r,o;return t&&document&&((o=(r=document==null?void 0:document.documentElement)==null?void 0:r.classList)==null||o.add(t)),()=>{var n,s;(s=(n=document==null?void 0:document.documentElement)==null?void 0:n.classList)==null||s.remove(t)}},[t]),de(C.Provider,{value:{currentTheme:t},children:e})}import{DROGASIL_TOKENS as ue,RAIA_TOKENS as ce,RDSAUDESISTEMAS_TOKENS as me}from"@raiadrogasil/pulso-design-tokens";import{useContext as fe}from"react";function h(){let{currentTheme:e}=fe(C);return{rdsaudesistemas:me,drogasil:ue,raia:ce}[e]}function _(e){let t=h();return Object.keys(t).reduce((n,s)=>{if(s.includes("color")){let a=s;n[a]=t[a]}return n},{})[e]}var k={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};import{jsx as xe}from"react/jsx-runtime";function T(n){var s=n,{symbol:e="rdicon-default",size:t="small",color:r="colorActionFillBrandPrimaryEnabled"}=s,o=u(s,["symbol","size","color"]);let a=e.replace("rdicon","").trim();return xe("i",i(l({},o),{title:a,className:e,style:{fontSize:k[t],color:_(r)}}))}function D(e){let t=h();return{brand:t.colorActionFillBrandPrimaryEnabled,neutral:t.colorTextNeutralReadonly,black:t.colorTextNeutralDefault,white:t.colorTextNeutralInverse}[e]}import{jsx as B,jsxs as Te}from"react/jsx-runtime";function L({color:e="brand",srText:t}){return B("div",{role:"status",className:"grid size-eightpulse place-items-center","aria-label":t,children:Te("svg",{className:"size-sixpulse animate-spin fill-none",viewBox:"0 0 24 24",children:[B("path",{fillRule:"evenodd",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0v2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12H0z",clipRule:"evenodd",fill:D(e)}),B("title",{children:t})]})})}import{forwardRef as Ie}from"react";import{createContextScope as ge}from"@radix-ui/react-context";import{createTV as be}from"tailwind-variants";var c=be({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var F=c({base:`
var me=Object.defineProperty,fe=Object.defineProperties;var xe=Object.getOwnPropertyDescriptors;var g=Object.getOwnPropertySymbols;var D=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable;var _=(e,t,r)=>t in e?me(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p=(e,t)=>{for(var r in t||(t={}))D.call(t,r)&&_(e,r,t[r]);if(g)for(var r of g(t))F.call(t,r)&&_(e,r,t[r]);return e},d=(e,t)=>fe(e,xe(t));var u=(e,t)=>{var r={};for(var o in e)D.call(e,o)&&t.indexOf(o)<0&&(r[o]=e[o]);if(e!=null&&g)for(var o of g(e))t.indexOf(o)<0&&F.call(e,o)&&(r[o]=e[o]);return r};import{createContext as be,useEffect as he}from"react";import{jsx as ye}from"react/jsx-runtime";var w=be({});function Xe({children:e,theme:t}){return he(()=>{var r,o;return t&&document&&((o=(r=document==null?void 0:document.documentElement)==null?void 0:r.classList)==null||o.add(t)),()=>{var n,a;(a=(n=document==null?void 0:document.documentElement)==null?void 0:n.classList)==null||a.remove(t)}},[t]),ye(w.Provider,{value:{currentTheme:t},children:e})}import{DROGASIL_TOKENS as Te,RAIA_TOKENS as Ie,RDSAUDESISTEMAS_TOKENS as ge}from"@raiadrogasil/pulso-design-tokens";import{useContext as Pe}from"react";function P(){let{currentTheme:e}=Pe(w);return{rdsaudesistemas:ge,drogasil:Te,raia:Ie}[e]}function L(e){let t=P();return Object.keys(t).reduce((n,a)=>{if(a.includes("color")){let s=a;n[s]=t[s]}return n},{})[e]}var H={tiny:"var(--sizing-tiny)","extra-small":"var(--sizing-extrasmall)",small:"var(--sizing-small)",medium:"var(--sizing-medium)"};import{jsx as ve}from"react/jsx-runtime";function h(n){var a=n,{symbol:e="rdicon-default",size:t="small",color:r="colorActionFillBrandPrimaryEnabled"}=a,o=u(a,["symbol","size","color"]);let s=e.replace("rdicon","").trim();return ve("i",d(p({},o),{title:s,className:e,style:{fontSize:H[t],color:L(r)}}))}function q(e){let t=P();return{brand:t.colorActionFillBrandPrimaryEnabled,neutral:t.colorTextNeutralReadonly,black:t.colorTextNeutralDefault,white:t.colorTextNeutralInverse}[e]}import{jsx as R,jsxs as Ce}from"react/jsx-runtime";function M({color:e="brand",srText:t}){return R("div",{role:"status",className:"grid size-eightpulse place-items-center","aria-label":t,children:Ce("svg",{className:"size-sixpulse animate-spin fill-none",viewBox:"0 0 24 24",children:[R("path",{fillRule:"evenodd",d:"M0 12c0 6.627 5.373 12 12 12s12-5.373 12-12S18.627 0 12 0v2c5.523 0 10 4.477 10 10s-4.477 10-10 10S2 17.523 2 12H0z",clipRule:"evenodd",fill:q(e)}),R("title",{children:t})]})})}import{forwardRef as Ne}from"react";import{createContextScope as Se}from"@radix-ui/react-context";import{createTV as Be}from"tailwind-variants";var f=Be({twMergeConfig:{extend:{classGroups:{"font-size":[{text:["threepulse","threeandhalfpulse"]}],"border-width":[{border:["quarterpulse","halfpulse"]}],"--tw-ring-inset":[{ring:["none","quarterpulse","halfpulse"]}]}}}});var G=f({base:`
tracking inline-flex items-center justify-center gap-twopulse rounded-pill

@@ -6,3 +6,3 @@ border-quarterpulse border-[transparent] font-bold font-rdmodern text-threeandhalfpulse truncate`,variants:{variant:{"brand-primary":`bg-action-fill-brand-primary-enabled text-text-neutral-inverse

enabled:active:border-action-border-neutral-secondary-pressed enabled:active:bg-action-fill-neutral-secondary-pressed enabled:hover:bg-action-fill-neutral-secondary-hovered`,"neutral-tertiary":`border-action-border-neutral-tertiary-enabled bg-action-fill-neutral-tertiary-enabled text-text-neutral
enabled:active:bg-action-fill-neutral-tertiary-pressed enabled:hover:bg-action-fill-neutral-tertiary-hovered`},size:{md:"h-medium min-w-medium px-fourpulse text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge px-fourpulse leading-small",lg:"h-mediumlarge min-w-mediumlarge px-fivepulse leading-small",xl:"h-mediumlarge min-w-mediumlarge px-sixpulse leading-small"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled outline-none",false:"outline-action-border-focused outline-offset-4 focus-visible:outline-1"},full:{true:"w-[100%]"},asIconOnly:{true:"aspect-square px-none"}},compoundVariants:[{variant:"brand-primary",disabled:!0,class:"border-action-border-brand-primary-disabled bg-action-fill-brand-primary-disabled"},{variant:"neutral-secondary",disabled:!0,class:"border-action-border-neutral-secondary-disabled bg-action-fill-neutral-secondary-disabled"},{variant:"neutral-tertiary",disabled:!0,class:"border-action-fill-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-enabled"}],defaultVariants:{variant:"brand-primary",size:"ml"}});import{jsx as he}from"react/jsx-runtime";function y(e){let p=e,{__scopeButton:t}=p,r=u(p,["__scopeButton"]),{variant:o,size:n,disabled:s}=I("ButtonIcon",t),a={"brand-primary":"colorTextNeutralInverse","neutral-secondary":"colorTextNeutralDefault","neutral-tertiary":"colorTextNeutralDefault"},d={md:"extra-small",ml:"small",lg:"small",xl:"small"};return he(T,i(l({},r),{color:s?"colorTextNeutralDisabled":a[o],size:d[n]}))}import{jsx as ye}from"react/jsx-runtime";function H(e){let s=e,{__scopeButton:t}=s,r=u(s,["__scopeButton"]),{variant:o}=I("ButtonRefresh",t),n={"brand-primary":"white","neutral-secondary":"neutral","neutral-tertiary":"black"};return ye(L,i(l({},r),{color:n[o]}))}import M from"react";function q(e){return M.Children.count(e)===1&&M.isValidElement(e)?e.type===y:!1}import{jsx as w}from"react/jsx-runtime";var R="Button",G=Ie((e,t)=>{let{children:r,variant:o,size:n,loading:s,disabled:a,full:d,__scopeButton:p}=e,f=s||a;return w(Pe,{scope:p,variant:o,size:n,disabled:a,children:w("button",i(l({},e),{ref:t,className:F({variant:o,size:n,disabled:a,full:d,asIconOnly:q(r)}),disabled:f,"aria-disabled":a,children:s?w(H,{}):r}))})});G.displayName=R;var[ve]=ge(R),[Pe,I]=ve(R),g={Root:G,Icon:y};import{Children as Ce,isValidElement as Be}from"react";var v=(e,t)=>{var o;let r=(o=Ce.toArray(e))==null?void 0:o.filter(n=>Be(n));return r.map((n,s)=>{let a=t.find(p=>n.type===p.child),d=r.reduce((p,f,P)=>(f==null?void 0:f.type)===n.type&&P<=s?p+1:p,0);return a&&d<=(a==null?void 0:a.amount)?n:null})};var K=c({base:`
enabled:active:bg-action-fill-neutral-tertiary-pressed enabled:hover:bg-action-fill-neutral-tertiary-hovered`},size:{md:"h-medium min-w-medium px-fourpulse text-threepulse leading-medium",ml:"h-mediumlarge min-w-mediumlarge px-fourpulse leading-small",lg:"h-mediumlarge min-w-mediumlarge px-fivepulse leading-small",xl:"h-mediumlarge min-w-mediumlarge px-sixpulse leading-small"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled outline-none",false:"outline-action-border-focused outline-offset-4 focus-visible:outline-1"},full:{true:"w-[100%]"},asIconOnly:{true:"aspect-square px-none"}},compoundVariants:[{variant:"brand-primary",disabled:!0,class:"border-action-border-brand-primary-disabled bg-action-fill-brand-primary-disabled"},{variant:"neutral-secondary",disabled:!0,class:"border-action-border-neutral-secondary-disabled bg-action-fill-neutral-secondary-disabled"},{variant:"neutral-tertiary",disabled:!0,class:"border-action-fill-neutral-tertiary-disabled bg-action-fill-neutral-tertiary-enabled"}],defaultVariants:{variant:"brand-primary",size:"ml"}});import{jsx as we}from"react/jsx-runtime";function v(e){let l=e,{__scopeButton:t}=l,r=u(l,["__scopeButton"]),{variant:o,size:n,disabled:a}=C("ButtonIcon",t),s={"brand-primary":"colorTextNeutralInverse","neutral-secondary":"colorTextNeutralDefault","neutral-tertiary":"colorTextNeutralDefault"},i={md:"extra-small",ml:"small",lg:"small",xl:"small"};return we(h,d(p({},r),{color:a?"colorTextNeutralDisabled":s[o],size:i[n]}))}import{jsx as Re}from"react/jsx-runtime";function K(e){let a=e,{__scopeButton:t}=a,r=u(a,["__scopeButton"]),{variant:o}=C("ButtonRefresh",t),n={"brand-primary":"white","neutral-secondary":"neutral","neutral-tertiary":"black"};return Re(M,d(p({},r),{color:n[o]}))}import Y from"react";function $(e){return Y.Children.count(e)===1&&Y.isValidElement(e)?e.type===v:!1}import{jsx as N}from"react/jsx-runtime";var S="Button",J=Ne((e,t)=>{let{children:r,variant:o,size:n,loading:a,disabled:s,full:i,className:l,__scopeButton:c}=e,m=a||s;return N(Ve,{scope:c,variant:o,size:n,disabled:s,children:N("button",d(p({},e),{ref:t,className:G({variant:o,size:n,disabled:s,full:i,className:l,asIconOnly:$(r)}),disabled:m,"aria-disabled":s,children:a?N(K,{}):r}))})});J.displayName=S;var[ze]=Se(S),[Ve,C]=ze(S),y={Root:J,Icon:v};import{Children as Oe,isValidElement as Ae}from"react";var B=(e,t)=>{var o;let r=(o=Oe.toArray(e))==null?void 0:o.filter(n=>Ae(n));return r.map((n,a)=>{let s=t.find(l=>n.type===l.child),i=r.reduce((l,c,m)=>(c==null?void 0:c.type)===n.type&&m<=a?l+1:l,0);return s&&i<=(s==null?void 0:s.amount)?n:null})};var U=f({base:`
group flex w-[100%] items-center justify-between gap-onepulse py-threepulse duration-100 ease-in

@@ -19,9 +19,9 @@ bg-forms-fill-filled ring-forms-border-filled ring-quarterpulse overflow-hidden

[&:not(:focus-within)]:has-[:placeholder-shown]:ring-none
`},{readOnly:!0,disabled:!1,class:"cursor-not-allowed bg-forms-fill-readonly ring-forms-border-readonly ring-quarterpulse"}],defaultVariants:{size:"ml",isFocused:!1,hasError:!1,readOnly:!1,disabled:!1}});import{jsx as we}from"react/jsx-runtime";var Y=o=>{var n=o,{children:e,__scopeInputText:t}=n,r=u(n,["children","__scopeInputText"]);let{disabled:s,hasError:a,readOnly:d,size:p}=m("InputTextActions",t);return we("div",i(l({},r),{className:K({size:p,disabled:s,readOnly:d,hasError:a}),"aria-disabled":s,"data-disabled":s,children:v(e,[{child:x.Icon,amount:2},{child:x.Field,amount:1},{child:x.ClearButton,amount:1}])}))};var J=c({base:"input-text-clear-button hidden",variants:{size:{md:"-mr-[6px]",ml:"-mr-[8px]",lg:"-mr-[8px]",xl:"-mr-[8px]"},readOnly:{true:""},disabled:{true:""}},compoundVariants:[{readOnly:!1,disabled:!1,class:"peer-focus/field:peer-[:not(:placeholder-shown)]/field:flex group-hover:peer-[:not(:placeholder-shown)]/field:flex"}],defaultVariants:{readOnly:!1,disabled:!1}});import{jsx as S}from"react/jsx-runtime";var U=r=>{var o=r,{__scopeInputText:e}=o,t=u(o,["__scopeInputText"]);let{size:n,disabled:s,readOnly:a}=m("InputTextClearButton",e);return S("div",{className:J({size:n,disabled:s,readOnly:a}),"aria-disabled":s||a,children:S(g.Root,i(l({},t),{size:n,disabled:s||a,variant:"neutral-tertiary",children:S(g.Icon,{symbol:"rdicon-dismiss-circle-outline"})}))})};import{forwardRef as Re}from"react";var X=c({base:`
`},{readOnly:!0,disabled:!1,class:"cursor-not-allowed bg-forms-fill-readonly ring-forms-border-readonly ring-quarterpulse"}],defaultVariants:{size:"ml",isFocused:!1,hasError:!1,readOnly:!1,disabled:!1}});import{jsx as Ee}from"react/jsx-runtime";var X=o=>{var n=o,{children:e,__scopeInputText:t}=n,r=u(n,["children","__scopeInputText"]);let{disabled:a,hasError:s,readOnly:i,size:l}=x("InputTextActions",t);return Ee("div",d(p({},r),{className:U({size:l,disabled:a,readOnly:i,hasError:s}),"aria-disabled":a,"data-disabled":a,children:B(e,[{child:T.Icon,amount:2},{child:T.Field,amount:1},{child:T.ClearButton,amount:1}])}))};var Q=f({base:"input-text-clear-button hidden",variants:{size:{md:"-mr-[6px]",ml:"-mr-[8px]",lg:"-mr-[8px]",xl:"-mr-[8px]"},readOnly:{true:""},disabled:{true:""}},compoundVariants:[{readOnly:!1,disabled:!1,class:"peer-focus/field:peer-[:not(:placeholder-shown)]/field:flex group-hover:peer-[:not(:placeholder-shown)]/field:flex"}],defaultVariants:{readOnly:!1,disabled:!1}});import{jsx as z}from"react/jsx-runtime";var W=r=>{var o=r,{__scopeInputText:e}=o,t=u(o,["__scopeInputText"]);let{size:n,disabled:a,readOnly:s}=x("InputTextClearButton",e);return z("div",{className:Q({size:n,disabled:a,readOnly:s}),"aria-disabled":a||s,children:z(y.Root,d(p({},t),{size:n,disabled:a||s,variant:"neutral-tertiary",children:z(y.Icon,{symbol:"rdicon-dismiss-circle-outline"})}))})};import{forwardRef as ke}from"react";var Z=f({base:`
peer/field flex w-[100%] bg-[transparent] !font-rdmodern font-regular text-text-neutral tracking-tiny leading-small
placeholder:opacity-transparent focus-visible:border-none focus-visible:outline-none
`,variants:{size:{md:"text-threepulse",ml:"text-threeandhalfpulse",lg:"text-threeandhalfpulse",xl:"text-threeandhalfpulse"},readOnly:{true:""},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{readOnly:!1,disabled:!1}});import{jsx as Se}from"react/jsx-runtime";var z=Re((o,r)=>{var n=o,{__scopeInputText:e}=n,t=u(n,["__scopeInputText"]);let{disabled:s,readOnly:a,size:d}=m("InputTextField",e);return Se("input",i(l({},t),{ref:r,disabled:s,readOnly:a,placeholder:"Placeholder is hidden",className:X({disabled:s,readOnly:a,size:d})}))});z.displayName="InputTextField";import{useMemo as ze}from"react";var Q=c({base:"justify-star flex w-[100%] flex-wrap items-center gap-onepulse px-twopulse text-left font-rdmodern font-semibold text-text-neutral-alternative text-threepulse",variants:{hasError:{true:"text-text-danger-alternative",false:""},readOnly:{true:"cursor-not-allowed"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"text-text-neutral-readonly"}],defaultVariants:{error:!1,disabled:!1,readOnly:!1}});import{jsx as N,jsxs as Ne}from"react/jsx-runtime";var W=s=>{var a=s,{withIcon:e,iconName:t="rdicon-warning-circle",children:r,__scopeInputText:o}=a,n=u(a,["withIcon","iconName","children","__scopeInputText"]);let{disabled:d,hasError:p,readOnly:f}=m("InputTextHelperText",o),P=p?"rdicon-warning-circle":t,ne=ze(()=>d?"colorTextNeutralDisabled":f?"colorTextNeutralReadonly":p?"colorTextDangerAlternative":"colorTextNeutralAlternative",[d,p,f]);return r?Ne("div",i(l({},n),{"aria-disabled":d,className:Q({hasError:p,disabled:d,readOnly:f}),children:[e&&N("div",{className:"flex items-center",children:N(T,{symbol:P,color:ne,size:"tiny"})}),N("span",{className:"flex flex-1",children:r})]})):null};import{useMemo as Ve}from"react";import{jsx as Z}from"react/jsx-runtime";function $(o){var n=o,{__scopeInputText:e,color:t="colorTextNeutralDefault"}=n,r=u(n,["__scopeInputText","color"]);let{size:s,hasError:a}=m("InputTextField",e),d=Ve(()=>{let p={md:"extra-small",ml:"small",lg:"small",xl:"small"};return p==null?void 0:p[s]},[s]);return Z("div",{className:"flex items-center",children:Z(T,i(l({},r),{color:a?"colorTextDangerAlternative":t,size:d}))})}var j=c({base:`
`,variants:{size:{md:"text-threepulse",ml:"text-threeandhalfpulse",lg:"text-threeandhalfpulse",xl:"text-threeandhalfpulse"},readOnly:{true:""},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{readOnly:!1,disabled:!1}});import{jsx as _e}from"react/jsx-runtime";var V=ke((o,r)=>{var n=o,{__scopeInputText:e}=n,t=u(n,["__scopeInputText"]);let{disabled:a,readOnly:s,size:i}=x("InputTextField",e);return _e("input",d(p({},t),{ref:r,disabled:a,readOnly:s,placeholder:"Placeholder is hidden",className:Z({disabled:a,readOnly:s,size:i})}))});V.displayName="InputTextField";import{useMemo as De}from"react";var j=f({base:"justify-star flex w-[100%] flex-wrap items-center gap-onepulse px-twopulse text-left font-rdmodern font-semibold text-text-neutral-alternative text-threepulse",variants:{hasError:{true:"text-text-danger-alternative",false:""},readOnly:{true:"cursor-not-allowed"},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"text-text-neutral-readonly"}],defaultVariants:{error:!1,disabled:!1,readOnly:!1}});import{jsx as O,jsxs as Fe}from"react/jsx-runtime";var ee=a=>{var s=a,{withIcon:e,iconName:t="rdicon-warning-circle",children:r,__scopeInputText:o}=s,n=u(s,["withIcon","iconName","children","__scopeInputText"]);let{disabled:i,hasError:l,readOnly:c}=x("InputTextHelperText",o),m=l?"rdicon-warning-circle":t,b=De(()=>i?"colorTextNeutralDisabled":c?"colorTextNeutralReadonly":l?"colorTextDangerAlternative":"colorTextNeutralAlternative",[i,l,c]);return r?Fe("div",d(p({},n),{"aria-disabled":i,className:j({hasError:l,disabled:i,readOnly:c}),children:[e&&O("div",{className:"flex items-center",children:O(h,{symbol:m,color:b,size:"tiny"})}),O("span",{className:"flex flex-1",children:r})]})):null};import{useMemo as Le}from"react";import{jsx as te}from"react/jsx-runtime";function re(o){var n=o,{__scopeInputText:e,color:t="colorTextNeutralDefault"}=n,r=u(n,["__scopeInputText","color"]);let{size:a,hasError:s}=x("InputTextField",e),i=Le(()=>{let l={md:"extra-small",ml:"small",lg:"small",xl:"small"};return l==null?void 0:l[a]},[a]);return te("div",{className:"flex items-center",children:te(h,d(p({},r),{color:s?"colorTextDangerAlternative":t,size:i}))})}var oe=f({base:`
w-[100%] align-middle m-none p-none
text-left font-rdmodern font-semibold tracking-tiny text-text-neutral text-nowrap truncate leading
`,variants:{size:{md:"text-threepulse",ml:"text-threeandhalfpulse",lg:"text-threeandhalfpulse",xl:"text-threeandhalfpulse"},readOnly:{true:"",false:""},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{disabled:!1,readOnly:!1}});import{jsx as ee}from"react/jsx-runtime";var te=e=>{let d=e,{__scopeInputText:t,children:r}=d,o=u(d,["__scopeInputText","children"]),{disabled:n,readOnly:s,size:a}=m("InputTextLabel",t);return r?ee("div",{className:"flex h-extrasmall w-[100%] items-center rounded-none rounded-none border-none px-twopulse text-left",children:ee("label",i(l({},o),{className:j({disabled:n,readOnly:s,size:a}),"aria-disabled":n,children:r}))}):null};import{createContextScope as Oe}from"@radix-ui/react-context";import{jsx as re}from"react/jsx-runtime";var V="InputText",oe=e=>{let{size:t="ml",children:r,__scopeInputText:o}=e;return re(Ee,i(l({},e),{size:t,scope:o,children:re("div",{className:"flex w-full flex-col gap-halfpulse",children:v(r,[{child:x.Label,amount:1},{child:x.Actions,amount:1},{child:x.HelperText,amount:1}])})}))};oe.displayName=V;var[Ae]=Oe(V),[Ee,m]=Ae(V),x={Root:oe,Label:te,Field:z,HelperText:W,Actions:Y,ClearButton:U,Icon:$};export{g as Button,T as Icon,x as InputText,L as Refresh,C as ThemeContext,De as ThemeProvider};
`,variants:{size:{md:"text-threepulse",ml:"text-threeandhalfpulse",lg:"text-threeandhalfpulse",xl:"text-threeandhalfpulse"},readOnly:{true:"",false:""},disabled:{true:"cursor-not-allowed text-text-neutral-disabled",false:""}},compoundVariants:[{readOnly:!0,disabled:!1,class:"cursor-not-allowed text-text-neutral-readonly"}],defaultVariants:{disabled:!1,readOnly:!1}});import{jsx as ne}from"react/jsx-runtime";var ae=e=>{let i=e,{__scopeInputText:t,children:r}=i,o=u(i,["__scopeInputText","children"]),{disabled:n,readOnly:a,size:s}=x("InputTextLabel",t);return r?ne("div",{className:"flex h-extrasmall w-[100%] items-center rounded-none rounded-none border-none px-twopulse text-left",children:ne("label",d(p({},o),{className:oe({disabled:n,readOnly:a,size:s}),"aria-disabled":n,children:r}))}):null};import{createContextScope as He}from"@radix-ui/react-context";import{jsx as se}from"react/jsx-runtime";var A="InputText",le=e=>{let{size:t="ml",children:r,__scopeInputText:o}=e;return se(Me,d(p({},e),{size:t,scope:o,children:se("div",{className:"flex w-full flex-col gap-halfpulse",children:B(r,[{child:T.Label,amount:1},{child:T.Actions,amount:1},{child:T.HelperText,amount:1}])})}))};le.displayName=A;var[qe]=He(A),[Me,x]=qe(A),T={Root:le,Label:ae,Field:V,HelperText:ee,Actions:X,ClearButton:W,Icon:re};import{useMemo as Ge}from"react";var ie=f({base:"flex px-none",variants:{hasCurrent:{false:"max-sm:hidden"}},defaultVariants:{hasCurrent:!1}});import{jsx as E}from"react/jsx-runtime";var pe=a=>{var s=a,{children:e,hasCurrent:t,href:r,item:o}=s,n=u(s,["children","hasCurrent","href","item"]);return E("li",{className:ie({hasCurrent:t}),children:E("a",{href:r,"aria-label":`P\xE1gina ${o}`,"aria-current":t,children:E(y.Root,d(p({},n),{variant:"neutral-tertiary",size:"lg","data-active":t,className:"data-[active=true]:bg-action-fill-neutral-tertiary-pressed",children:o}))})})};import{jsx as de}from"react/jsx-runtime";var k=n=>{var a=n,{control:e,children:t,disabled:r}=a,o=u(a,["control","children","disabled"]);return de("a",d(p({},o),{"aria-disabled":r,href:e==null?void 0:e.href,children:de(y.Root,{disabled:r,variant:"neutral-secondary",size:"lg",onClick:e==null?void 0:e.onClickEvent,children:t})}))};import{jsx as ue}from"react/jsx-runtime";var ce=()=>ue("li",{className:"flex items-center max-sm:hidden",children:ue(h,{symbol:"rdicon-more-horizontal",size:"medium",color:"colorTextNeutralDefault"})});import{jsx as I,jsxs as Ye}from"react/jsx-runtime";var Ke=({current:e,total:t,pagesMapper:r,onPageClick:o,prevControl:n,nextControl:a})=>{let s=Ge(()=>{var c;let i=new Set([1,Number(e),Number(t)]),l=(c=Array.from(i))==null?void 0:c.map(m=>({id:m,page:r==null?void 0:r[m-1]}));return l==null?void 0:l.filter(m=>{var b;return!!((b=m==null?void 0:m.page)!=null&&b.href)})},[e,t,r]);return Ye("nav",{className:"flex flex-row items-center gap-twopulse max-sm:gap-threepulse",children:[I(k,{control:n,disabled:e===1,"aria-label":"Anterior",children:"Anterior"}),I("ol",{className:"flex flex-row items-center gap-onepulse",children:s.map(({id:i,page:l},c)=>{let m=i===e,b=s==null?void 0:s[c-1];return[!!b&&i-(b==null?void 0:b.id)>1&&I(ce,{},`${i}-ellipse`),I(pe,{item:i,hasCurrent:m,href:l==null?void 0:l.href,onClick:o},i)]})}),I(k,{control:a,disabled:e===t,"aria-label":"Pr\xF3ximo",children:"Pr\xF3ximo"})]})};export{y as Button,h as Icon,T as InputText,Ke as Pagination,M as Refresh,w as ThemeContext,Xe as ThemeProvider};
//# sourceMappingURL=index.js.map
{
"name": "@rdsaude/pulso-react-components",
"version": "1.2.0",
"version": "1.3.0-alpha.0",
"description": "Biblioteca de componentes React do Pulso Design System da RD Saúde oferece componentes consistentes e de alto desempenho, alinhados com os padrões da RDSaúde. Ideal para desenvolver aplicações modernas e acessíveis.",

@@ -5,0 +5,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc