tcce-design-system 0.1.7 → 0.1.9

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.
@@ -8718,7 +8718,7 @@ const Us = k.div`
8718
8718
  onChange: A,
8719
8719
  ...V
8720
8720
  }) => {
8721
- const [z, D, K] = _c(e), U = !!(D.touched && D.error), Tt = U ? D.error : void 0, et = t?.toString?.() || e, O = {
8721
+ const [z, D, K] = _c(e), U = !!(D.error && (D.touched || D.value)), Tt = U ? D.error : void 0, et = t?.toString?.() || e, O = {
8722
8722
  required: a || void 0,
8723
8723
  "aria-required": a || void 0,
8724
8724
  "aria-invalid": U || void 0,
@@ -10382,7 +10382,7 @@ const _y = k.header`
10382
10382
  justify-content: space-between;
10383
10383
  padding: 0 1rem;
10384
10384
  transition: padding-left 0.3s ease-out;
10385
- margin-left: 5rem;
10385
+ padding-left: 5rem
10386
10386
  `, Hy = k.div`
10387
10387
  display: flex;
10388
10388
  align-items: center;
@@ -10541,9 +10541,13 @@ const Yy = k.div`
10541
10541
  ),
10542
10542
  /* @__PURE__ */ p(Gy, { className: h, children: t })
10543
10543
  ] }), v1 = (t) => /* @__PURE__ */ p(J0, { children: /* @__PURE__ */ p(Xy, { ...t }) });
10544
- function b1(t, e, n = 1) {
10545
- const r = new Date(Date.now() + n * 864e5).toUTCString();
10546
- document.cookie = `${t}=${encodeURIComponent(e)}; expires=${r}; path=/; SameSite=Strict; Secure`;
10544
+ function b1(t, e, n) {
10545
+ let r = `${t}=${encodeURIComponent(e)}; path=/; SameSite=Strict; Secure`;
10546
+ if (n) {
10547
+ const i = new Date(Date.now() + n * 864e5).toUTCString();
10548
+ r += `; expires=${i}`;
10549
+ }
10550
+ document.cookie = r;
10547
10551
  }
10548
10552
  function x1(t) {
10549
10553
  return document.cookie.split("; ").reduce((e, n) => {
@@ -946,7 +946,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[En]+=1);const yr={80:P`
946
946
  display: flex;
947
947
  flex-direction: column;
948
948
  gap: 0.75rem;
949
- `,V0=({id:e,name:t,label:n,type:r="text",size:o="md",placeholder:s,disabled:i=!1,required:a=!1,options:c=[],checkboxLabel:d,radioName:u,pinLength:l=6,pinType:h="number",className:m,inputClassName:g,labelClassName:v,messageErrorClassName:w,leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,onOptionSelect:C,onRadioChange:S,onPinComplete:k,onChange:D,...I})=>{const[_,M,K]=Lc.useField(t),W=!!(M.touched&&M.error),Pe=W?M.error:void 0,re=e?.toString?.()||t,F={required:a||void 0,"aria-required":a||void 0,"aria-invalid":W||void 0,"aria-describedby":W?`${re}-error`:void 0},N=$=>{if(D)return D($);_.onChange($)};let R;switch(r){case"textarea":{const $=j=>{D?D(j):_.onChange(j)};R=p.jsx(zo,{id:re,name:t,className:g,hasError:W,disabled:i,value:_.value??"",size:o,placeholder:s,onChange:$,...I,...F});break}case"select":{R=p.jsx(Ro,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,value:_.value??"",onChange:$=>{_.onChange($);const j=c.find(oe=>String(oe.value)===$.target.value);j&&C?.(j)},options:c,placeholder:s||"Selecciona una opción",...I,...F});break}case"checkbox":{R=p.jsx(qn,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,checked:!!_.value,label:d,onChange:$=>{K.setValue($.target.checked)},...I,...F});break}case"radio":{const $=c;R=p.jsx(M0,{children:$.map(j=>p.jsx(Yo,{name:u||t,value:j.value,label:j.label,size:o,hasError:W,disabled:i,checked:_.value===j.value,onChange:oe=>{const ie=oe.target.value,O=typeof j.value=="number"?Number(ie):ie;K.setValue(O),S?.(oe)},...F},j.value))});break}case"pin":{R=p.jsx(Uo,{length:l,type:h,size:o,hasError:W,onChange:$=>K.setValue($),onComplete:$=>{K.setValue($),k?.($)},...I,...F});break}case"password":{const{rightIcon:$,...j}=I;R=p.jsx(Ql,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,placeholder:s,leftIcon:y,iconSize:b,iconColor:A,onChange:N,...j,...F});break}case"search":{R=p.jsx(tc,{className:g,size:o,placeholder:s,leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,onSearch:I.onSearch,...F});break}default:R=p.jsx(jo,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,placeholder:s,type:["text","email","number","tel","url","date","date","datetime-local","time"].includes(r)?r:"text",leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,value:_.value??"",onChange:N,...I,...F})}return r==="checkbox"?p.jsxs(ac,{className:m,children:[R,W&&p.jsx(Fo,{id:`${re}-error`,size:o,className:w,children:Pe})]}):p.jsxs(ac,{className:m,children:[n&&p.jsx(Gn,{htmlFor:re,size:o,required:a,disabled:i,className:v,children:n}),R,W&&p.jsx(Fo,{id:`${re}-error`,size:o,className:w,children:Pe})]})},lc={initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeInOut"},layout:!1},Go={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"}},$0={fromBottom:{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeInOut"}},fromTop:{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeInOut"}},fromLeft:{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2,ease:"easeInOut"}},fromRight:{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.2,ease:"easeInOut"}}},cc={initial:{height:0,opacity:0,y:-6},animate:{height:"auto",opacity:1,y:0},exit:{height:0,opacity:0,y:-6},transition:{duration:.2,ease:"easeInOut"}},I0=T(ze.div)`
949
+ `,V0=({id:e,name:t,label:n,type:r="text",size:o="md",placeholder:s,disabled:i=!1,required:a=!1,options:c=[],checkboxLabel:d,radioName:u,pinLength:l=6,pinType:h="number",className:m,inputClassName:g,labelClassName:v,messageErrorClassName:w,leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,onOptionSelect:C,onRadioChange:S,onPinComplete:k,onChange:D,...I})=>{const[_,M,K]=Lc.useField(t),W=!!(M.error&&(M.touched||M.value)),Pe=W?M.error:void 0,re=e?.toString?.()||t,F={required:a||void 0,"aria-required":a||void 0,"aria-invalid":W||void 0,"aria-describedby":W?`${re}-error`:void 0},N=$=>{if(D)return D($);_.onChange($)};let R;switch(r){case"textarea":{const $=j=>{D?D(j):_.onChange(j)};R=p.jsx(zo,{id:re,name:t,className:g,hasError:W,disabled:i,value:_.value??"",size:o,placeholder:s,onChange:$,...I,...F});break}case"select":{R=p.jsx(Ro,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,value:_.value??"",onChange:$=>{_.onChange($);const j=c.find(oe=>String(oe.value)===$.target.value);j&&C?.(j)},options:c,placeholder:s||"Selecciona una opción",...I,...F});break}case"checkbox":{R=p.jsx(qn,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,checked:!!_.value,label:d,onChange:$=>{K.setValue($.target.checked)},...I,...F});break}case"radio":{const $=c;R=p.jsx(M0,{children:$.map(j=>p.jsx(Yo,{name:u||t,value:j.value,label:j.label,size:o,hasError:W,disabled:i,checked:_.value===j.value,onChange:oe=>{const ie=oe.target.value,O=typeof j.value=="number"?Number(ie):ie;K.setValue(O),S?.(oe)},...F},j.value))});break}case"pin":{R=p.jsx(Uo,{length:l,type:h,size:o,hasError:W,onChange:$=>K.setValue($),onComplete:$=>{K.setValue($),k?.($)},...I,...F});break}case"password":{const{rightIcon:$,...j}=I;R=p.jsx(Ql,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,placeholder:s,leftIcon:y,iconSize:b,iconColor:A,onChange:N,...j,...F});break}case"search":{R=p.jsx(tc,{className:g,size:o,placeholder:s,leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,onSearch:I.onSearch,...F});break}default:R=p.jsx(jo,{id:re,name:t,className:g,hasError:W,disabled:i,size:o,placeholder:s,type:["text","email","number","tel","url","date","date","datetime-local","time"].includes(r)?r:"text",leftIcon:y,rightIcon:x,iconSize:b,iconColor:A,value:_.value??"",onChange:N,...I,...F})}return r==="checkbox"?p.jsxs(ac,{className:m,children:[R,W&&p.jsx(Fo,{id:`${re}-error`,size:o,className:w,children:Pe})]}):p.jsxs(ac,{className:m,children:[n&&p.jsx(Gn,{htmlFor:re,size:o,required:a,disabled:i,className:v,children:n}),R,W&&p.jsx(Fo,{id:`${re}-error`,size:o,className:w,children:Pe})]})},lc={initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.2,ease:"easeInOut"},layout:!1},Go={initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.3,ease:"easeInOut"}},$0={fromBottom:{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeInOut"}},fromTop:{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},transition:{duration:.2,ease:"easeInOut"}},fromLeft:{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.2,ease:"easeInOut"}},fromRight:{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{duration:.2,ease:"easeInOut"}}},cc={initial:{height:0,opacity:0,y:-6},animate:{height:"auto",opacity:1,y:0},exit:{height:0,opacity:0,y:-6},transition:{duration:.2,ease:"easeInOut"}},I0=T(ze.div)`
950
950
  position: fixed;
951
951
  inset: 0;
952
952
  z-index: 50;
@@ -1633,7 +1633,7 @@ See https://s-c.sh/2BAXzed for more info.`),window[En]+=1);const yr={80:P`
1633
1633
  justify-content: space-between;
1634
1634
  padding: 0 1rem;
1635
1635
  transition: padding-left 0.3s ease-out;
1636
- margin-left: 5rem;
1636
+ padding-left: 5rem
1637
1637
  `,ky=T.div`
1638
1638
  display: flex;
1639
1639
  align-items: center;
@@ -1703,4 +1703,4 @@ See https://s-c.sh/2BAXzed for more info.`),window[En]+=1);const yr={80:P`
1703
1703
  @media (min-width: 1200px) {
1704
1704
  margin-left: 5rem;
1705
1705
  }
1706
- `,Vy=({children:e,navigationConfig:t,userRoles:n=[],activePath:r,user:o,hasNotifications:s=!1,notificationCount:i,onNavigate:a,onNotificationClick:c,onUserProfileClick:d,onLogout:u,userMenuItems:l=[],contentClassName:h,logoImgCollapsed:m,logoImgExpanded:g})=>p.jsxs(Dy,{children:[p.jsx(Zo,{navigationConfig:t,userRoles:n,onNavigate:a,activePath:r,logoImgCollapsed:m,logoImgExpanded:g}),p.jsx(ni,{user:o,hasNotifications:s,notificationCount:i,onNotificationClick:c,onUserProfileClick:d,onLogout:u,userMenuItems:l}),p.jsx(My,{className:h,children:e})]}),$y=e=>p.jsx(pc,{children:p.jsx(Vy,{...e})});function Iy(e,t,n=1){const r=new Date(Date.now()+n*864e5).toUTCString();document.cookie=`${e}=${encodeURIComponent(t)}; expires=${r}; path=/; SameSite=Strict; Secure`}function Ny(e){return document.cookie.split("; ").reduce((t,n)=>{const r=n.split("=");return r[0]===e?decodeURIComponent(r[1]):t},"")}function Ly(e){document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}E.ALLOWED_INPUT_TYPES=Gl,E.BaseInput=jo,E.Button=Bo,E.ButtonSpinner=Wl,E.Card=yg,E.CardBody=xg,E.CardFooter=Tg,E.CardHeader=bg,E.Checkbox=qn,E.CheckboxInput=_o,E.CheckboxLabel=nc,E.Dialog=dc,E.DialogBody=hc,E.DialogFooter=fc,E.DialogHeader=uc,E.ErrorMessage=Fo,E.FormField=V0,E.FullScreenSpinner=Mm,E.Header=ni,E.HeadingBold=An,E.HeadingRegular=Hd,E.Icon=Y,E.IconWrapperStyles=an,E.Label=Gn,E.Layout=$y,E.Link=yc,E.PasswordInput=Ql,E.PinInput=Ho,E.PinInputGroup=Uo,E.RadioInput=Yo,E.RadioInputDot=Wo,E.RadioInputLabel=Ko,E.SearchInput=tc,E.SectionSpinner=$m,E.SelectInput=Ro,E.Sidebar=Zo,E.SidebarContext=Xo,E.SidebarProvider=pc,E.Spinner=Kn,E.Table=Cc,E.TableCell=ti,E.TableHeaderCell=ei,E.TermsAndConditions=j0,E.Text=We,E.TextAreaInput=zo,E.ToastProvider=ug,E.baseContentTableStyles=Jo,E.baseFieldStyles=ut,E.baseInputStyles=Xn,E.baseTableCellsSizes=ft,E.bodyTextStyles=z,E.createFieldConfig=Mg,E.createInputRefs=sc,E.deleteCookie=Ly,E.disabledStyles=Ze,E.errorStyles=ht,E.flushedStyles=ql,E.getCookie=Ny,E.getPropsForInputType=Vg,E.handleDigitChange=rc,E.handleKeyDown=oc,E.handlePaste=ic,E.hasPermission=qo,E.headingBoldStyles=yr,E.headingRegularStyles=Xi,E.isAllowedInputType=Xl,E.normalizeFieldTypes=qe,E.normalizeSelectOptions=Dg,E.overlayAnimation=Go,E.setCookie=Iy,E.sizeStyles=sn,E.slideAnimation=$0,E.smartAnimation=lc,E.submenuAnimationTopDown=cc,E.tableHoverMixin=bc,E.tableIconContainerStyles=Qo,E.tableResponsiveMixin=wc,E.tableVariants=vc,E.toast=Qm,E.validateCode=S0,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
1706
+ `,Vy=({children:e,navigationConfig:t,userRoles:n=[],activePath:r,user:o,hasNotifications:s=!1,notificationCount:i,onNavigate:a,onNotificationClick:c,onUserProfileClick:d,onLogout:u,userMenuItems:l=[],contentClassName:h,logoImgCollapsed:m,logoImgExpanded:g})=>p.jsxs(Dy,{children:[p.jsx(Zo,{navigationConfig:t,userRoles:n,onNavigate:a,activePath:r,logoImgCollapsed:m,logoImgExpanded:g}),p.jsx(ni,{user:o,hasNotifications:s,notificationCount:i,onNotificationClick:c,onUserProfileClick:d,onLogout:u,userMenuItems:l}),p.jsx(My,{className:h,children:e})]}),$y=e=>p.jsx(pc,{children:p.jsx(Vy,{...e})});function Iy(e,t,n){let r=`${e}=${encodeURIComponent(t)}; path=/; SameSite=Strict; Secure`;if(n){const o=new Date(Date.now()+n*864e5).toUTCString();r+=`; expires=${o}`}document.cookie=r}function Ny(e){return document.cookie.split("; ").reduce((t,n)=>{const r=n.split("=");return r[0]===e?decodeURIComponent(r[1]):t},"")}function Ly(e){document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`}E.ALLOWED_INPUT_TYPES=Gl,E.BaseInput=jo,E.Button=Bo,E.ButtonSpinner=Wl,E.Card=yg,E.CardBody=xg,E.CardFooter=Tg,E.CardHeader=bg,E.Checkbox=qn,E.CheckboxInput=_o,E.CheckboxLabel=nc,E.Dialog=dc,E.DialogBody=hc,E.DialogFooter=fc,E.DialogHeader=uc,E.ErrorMessage=Fo,E.FormField=V0,E.FullScreenSpinner=Mm,E.Header=ni,E.HeadingBold=An,E.HeadingRegular=Hd,E.Icon=Y,E.IconWrapperStyles=an,E.Label=Gn,E.Layout=$y,E.Link=yc,E.PasswordInput=Ql,E.PinInput=Ho,E.PinInputGroup=Uo,E.RadioInput=Yo,E.RadioInputDot=Wo,E.RadioInputLabel=Ko,E.SearchInput=tc,E.SectionSpinner=$m,E.SelectInput=Ro,E.Sidebar=Zo,E.SidebarContext=Xo,E.SidebarProvider=pc,E.Spinner=Kn,E.Table=Cc,E.TableCell=ti,E.TableHeaderCell=ei,E.TermsAndConditions=j0,E.Text=We,E.TextAreaInput=zo,E.ToastProvider=ug,E.baseContentTableStyles=Jo,E.baseFieldStyles=ut,E.baseInputStyles=Xn,E.baseTableCellsSizes=ft,E.bodyTextStyles=z,E.createFieldConfig=Mg,E.createInputRefs=sc,E.deleteCookie=Ly,E.disabledStyles=Ze,E.errorStyles=ht,E.flushedStyles=ql,E.getCookie=Ny,E.getPropsForInputType=Vg,E.handleDigitChange=rc,E.handleKeyDown=oc,E.handlePaste=ic,E.hasPermission=qo,E.headingBoldStyles=yr,E.headingRegularStyles=Xi,E.isAllowedInputType=Xl,E.normalizeFieldTypes=qe,E.normalizeSelectOptions=Dg,E.overlayAnimation=Go,E.setCookie=Iy,E.sizeStyles=sn,E.slideAnimation=$0,E.smartAnimation=lc,E.submenuAnimationTopDown=cc,E.tableHoverMixin=bc,E.tableIconContainerStyles=Qo,E.tableResponsiveMixin=wc,E.tableVariants=vc,E.toast=Qm,E.validateCode=S0,Object.defineProperty(E,Symbol.toStringTag,{value:"Module"})}));
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.1.7",
6
+ "version": "0.1.9",
7
7
  "description": "This package provides reusable UI components to ensure consistency across all CRM frontend applications",
8
8
  "author": "BizAppsTotal <bizapps@tcce.biz>",
9
9
  "type": "module",