cemtrik-dependencies 1.1.0 → 1.1.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 CHANGED
@@ -266,6 +266,53 @@ Storybook scripts live in `storybook/package.json`:
266
266
  | `npm run generate-docs` | Generate Storybook docs |
267
267
  | `npm run deploy` | Deploy Storybook to Firebase hosting |
268
268
 
269
+ ## Publishing
270
+
271
+ Use this flow to publish a new version of the package safely from the repository root.
272
+
273
+ ### 1. Confirm access
274
+
275
+ ```bash
276
+ npm whoami
277
+ ```
278
+
279
+ If npm requires 2FA for publishing, use a granular access token with `Bypass two-factor authentication` enabled and configure it locally for the session.
280
+
281
+ ### 2. Verify the release candidate
282
+
283
+ ```bash
284
+ npm run lint
285
+ npm test -- --runInBand
286
+ npm run build
287
+ npm publish --dry-run
288
+ ```
289
+
290
+ ### 3. Bump the version
291
+
292
+ Use semantic versioning intentionally:
293
+
294
+ - `npm version patch` for bug fixes and non-breaking changes
295
+ - `npm version minor` for new backward-compatible features
296
+ - `npm version major` for breaking changes
297
+
298
+ ### 4. Publish
299
+
300
+ ```bash
301
+ npm publish
302
+ ```
303
+
304
+ ### 5. Verify on npm
305
+
306
+ Confirm the new version on the package page:
307
+
308
+ https://www.npmjs.com/package/cemtrik-dependencies
309
+
310
+ Notes:
311
+
312
+ - Do not run `npm version` more than once for the same release.
313
+ - The published tarball comes from `dist/` only.
314
+ - Do not commit npm tokens or store them in the repository.
315
+
269
316
  ## License
270
317
 
271
318
  Copyright 2024 Cemtrik. All rights reserved.
package/dist/index.js CHANGED
@@ -53,7 +53,7 @@ React keys must be passed directly to JSX without using spread:
53
53
  input[type="number"] {
54
54
  -moz-appearance: textfield;
55
55
  }
56
- `}),u.jsxs("div",{"data-testid":`container-input-${h}`,className:x,children:[t!==""&&u.jsx("label",{htmlFor:r,className:k("block text-sm font-medium leading-6",g!==""?g:"text-gray-700"),"data-testid":`label-${h}`,children:t}),u.jsxs("div",{className:"relative mt-0.5 rounded-md shadow-sm",children:[u.jsx("div",{className:"absolute flex items-center",style:{left:"2px",top:"1px"},children:u.jsx(Er,{name:E,onChange:$=>o($),id:E,options:y,value:a,isReadOnly:d,className:S,height:H<=640?"28px":"32px",classNameInput:k(N&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},styleMenu:{width:e===null?"fit-content":`${B}px`},isDisabledFocus:!0})}),u.jsx("input",{ref:z,id:h,name:s,type:T,autoComplete:v,placeholder:n,readOnly:d,"data-testid":`input-${h}`,onClick:i,onKeyDown:A,onChange:$=>o($),value:l,className:k("block w-full rounded-md border-0 py-1.5 pl-24 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6 focus:outline-none",G,b!==""&&b)}),f&&u.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:u.jsx(pr,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!f?null:u.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${h}`,children:m})]})]})},ua=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1,handleClick:r,text:s="",updateStatus:o=!1,id:i="status",isHiddenText:l=!1,setForm:a,handleChange:d,textActive:f="Activo",textInactive:m="Inactivo"})=>{const[v,h]=c.useState(!1);c.useEffect(()=>{h(n),e(i,n),a(x=>({...x,[i]:n}))},[n,e,o,a,i]);const g=()=>{h(!v),e(i,!v),a(x=>({...x,[i]:!v})),d({target:{checked:!v,value:!v,name:i,type:"",id:""}}),r&&r()};return u.jsxs("div",{className:"flex",children:[u.jsxs(Gi,{checked:v,onChange:g,className:k("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-5 focus:ring-offset-2 mt-1",v?"bg-success-5":"bg-gray-200"),"data-testid":`switch-${i}`,disabled:t,children:[u.jsx("span",{className:"sr-only",children:"Use setting"}),u.jsx("span",{"aria-hidden":"true",className:k("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",v?"translate-x-full":"translate-x-0")})]}),s!==""?u.jsx("p",{className:k("text-sm font-medium text-gray-500 ml-2 self-end",l&&"hidden"),children:s}):u.jsx("p",{className:k("text-sm font-medium text-gray-500 ml-2 self-end",l&&"hidden"),"data-testid":"text-switch",children:v?f:m})]})};function ca({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:s="",rows:o=4,name:i,placeholder:l="",helperText:a="",isReadOnly:d=!1,isError:f=!1,onChange:m,value:v,idInput:h,nameInput:g,placeholderInput:x="",isReadOnlyInput:b=!1,valueInput:A,infoTop:y=null,infoBottom:E=null,classNameInfoTop:N="h-4",classNameInfoBottom:S="h-2",isInputTitle:T=!1,hiddenBorder:z=!1}){const U=Ne({"ring-red-300 focus:ring-red-300 text-red-900":f,"focus:ring-primary-7 text-gray-700":!f});return u.jsxs(u.Fragment,{children:[e!==""&&u.jsx("label",{htmlFor:t,className:k("leading-6 block text-sm",r!==""&&r),children:e}),u.jsxs("div",{className:"relative overflow-x-hidden",children:[y!==null&&u.jsx("div",{className:"absolute top-2 left-3 w-full",children:y}),u.jsxs("div",{className:k("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-7 placeholder:text-gray-400 bg-white",U),children:[y!==null&&u.jsx("div",{className:"py-2","aria-hidden":"true",children:u.jsx("div",{className:"py-px",children:u.jsx("div",{className:N})})}),T&&u.jsx("textarea",{name:g,id:h,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:x,value:A,onChange:m,rows:2,readOnly:b}),u.jsx("textarea",{placeholder:l,rows:o,name:i,id:n,className:k(T||z?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",U,s!==""&&s),readOnly:d,onChange:m,value:v,"data-testid":`textarea-${n}`}),E!==null&&u.jsx("div",{className:"py-2","aria-hidden":"true",children:u.jsx("div",{className:"py-px",children:u.jsx("div",{className:S})})})]}),E!==null&&u.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:E})]}),a.length>0&&f&&u.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Cr=({children:e,data:n,className:t="",classNameTooltip:r="w-full",classNameMenu:s="",classNameMenuItems:o="",classNameContainerSearch:i="px-5",isSelectMultiple:l=!1,optionsSelect:a,propObject:d="name",propId:f="id",textNewItem:m="",defaultId:v=null,loading:h=!1,search:g=null,searchPlaceHolder:x="Buscar...",valueSearch:b=void 0,idsOptionSelect:A=null,isComponent:y,isSticky:E=!1,hiddenMenu:N=!1,id:S,onClick:T=()=>{},isRelative:z=!0,isMaxWidth:U=!1,isTag:H=!1,isClear:B=!1,clear:D=null,applyButton:G=null,applyButtonText:$="Aplicar",tagsParent:J=[],isClearTagsParent:j=!1,isReadOnly:X,isDisabledApplyButton:te=!0,isOpenMenu:w=void 0,onScroll:I=null,allValues:P=null})=>{const W=c.useRef(null),ee=c.useRef(null),[Z,ne]=c.useState(new Set),[me,ie]=c.useState(new Map);c.useEffect(()=>{A!==null&&ne(new Set(new Set(A)))},[A]),c.useEffect(()=>{j&&ie(new Map)},[j]),c.useEffect(()=>{if(J.length===0)return;const F=new Map;J.forEach(K=>F.set(K.id,K)),ie(F)},[J]),c.useEffect(()=>{B&&(ne(new Set),ie(new Map),D&&D())},[D,B]);const Q=F=>{let K=new Map(me),ae=new Set(Z),Oe=null;if(v!==null&&(F[f]===v&&(Oe=crypto.randomUUID()),Oe!==null&&(F[f]=Oe),Oe!==null&&(F[d]=F[d].replace(m,"").trim())),ae.has(F[f])?ae.delete(F[f]):ae.add(F[f]),K.has(F[f])?K.delete(F[f]):K.set(F[f],F),F[f]==="all"&&P&&Array.isArray(P)&&(ae.has(F[f])?P.forEach(Ee=>{ae.add(Ee[f]),K.set(Ee[f],Ee)}):(ae.clear(),K.clear())),F[f]!=="all"&&P){const Ee=P.find(Ge=>Ge.id==="all");ae.size===P.length-1&&ae.add("all"),ae.size===P.length-1&&K.set("all",Ee),ae.size<P.length&&ae.delete("all"),ae.size<P.length&&K.delete("all")}if(!l){const Ee=Array.from(ae),Ge=Array.from(K);Ee.shift(),Ge.shift(),ae=ae.size===2?new Set(Ee):ae,K=K.size===2?new Map(Ge):K}a(F,Array.from(ae),Oe!==null),ne(ae),ie(K)},re=F=>{T(F===!0?-1:S)},M=F=>{const K=new Set(Z),ae=new Map(me);K.delete(F[f]),ae.delete(F[f]),a(F,Array.from(K)),ne(K),ie(ae)},V=()=>{if(Z.size===0)return;const F=new Set(Z),K=new Map(me);F.clear(),K.clear(),a(null,Array.from(F)),ne(F),ie(K)};function q(F){if(typeof F!="string")return F;const K=F.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}const we=(F,K)=>F.description!==void 0&&F.description!==null?u.jsxs("span",{className:"flex flex-col",children:[u.jsx("span",{className:K?"font-semibold":"text-gray-900 font-semibold",children:q(F[d])}),u.jsx("span",{className:K?"font-normal":"text-gray-500 font-normal",children:F.description})]}):q(F[d]);return u.jsxs(Ct,{as:"div",className:k("inline-block text-left",z&&"relative",s!==""&&s),onClick:()=>re(!0),"data-testid":`menu-${S}`,id:S,ref:W,children:[u.jsx("style",{children:`
56
+ `}),u.jsxs("div",{"data-testid":`container-input-${h}`,className:x,children:[t!==""&&u.jsx("label",{htmlFor:r,className:k("block text-sm font-medium leading-6",g!==""?g:"text-gray-700"),"data-testid":`label-${h}`,children:t}),u.jsxs("div",{className:"relative mt-0.5 rounded-md shadow-sm",children:[u.jsx("div",{className:"absolute flex items-center",style:{left:"2px",top:"1px"},children:u.jsx(Er,{name:E,onChange:$=>o($),id:E,options:y,value:a,isReadOnly:d,className:S,height:H<=640?"28px":"32px",classNameInput:k(N&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},styleMenu:{width:e===null?"fit-content":`${B}px`},isDisabledFocus:!0})}),u.jsx("input",{ref:z,id:h,name:s,type:T,autoComplete:v,placeholder:n,readOnly:d,"data-testid":`input-${h}`,onClick:i,onKeyDown:A,onChange:$=>o($),value:l,className:k("block w-full rounded-md border-0 py-1.5 pl-24 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6 focus:outline-none",G,b!==""&&b)}),f&&u.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:u.jsx(pr,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),m.length===0||!f?null:u.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${h}`,children:m})]})]})},ua=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1,handleClick:r,text:s="",updateStatus:o=!1,id:i="status",isHiddenText:l=!1,setForm:a,handleChange:d,textActive:f="Activo",textInactive:m="Inactivo"})=>{const[v,h]=c.useState(!1);c.useEffect(()=>{h(n),e(i,n),a(x=>({...x,[i]:n}))},[n,e,o,a,i]);const g=()=>{h(!v),e(i,!v),a(x=>({...x,[i]:!v})),d({target:{checked:!v,value:!v,name:i,type:"",id:""}}),r&&r()};return u.jsxs("div",{className:"flex",children:[u.jsxs(Gi,{checked:v,onChange:g,className:k("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-5 focus:ring-offset-2 mt-1",v?"bg-success-5":"bg-gray-200"),"data-testid":`switch-${i}`,disabled:t,children:[u.jsx("span",{className:"sr-only",children:"Use setting"}),u.jsx("span",{"aria-hidden":"true",className:k("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",v?"translate-x-full":"translate-x-0")})]}),s!==""?u.jsx("p",{className:k("text-sm font-medium text-gray-500 ml-2 self-end",l&&"hidden"),children:s}):u.jsx("p",{className:k("text-sm font-medium text-gray-500 ml-2 self-end",l&&"hidden"),"data-testid":"text-switch",children:v?f:m})]})};function ca({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:s="",rows:o=4,name:i,placeholder:l="",helperText:a="",isReadOnly:d=!1,isError:f=!1,onChange:m,value:v,idInput:h,nameInput:g,placeholderInput:x="",isReadOnlyInput:b=!1,valueInput:A,infoTop:y=null,infoBottom:E=null,classNameInfoTop:N="h-4",classNameInfoBottom:S="h-2",isInputTitle:T=!1,hiddenBorder:z=!1}){const U=Ne({"ring-red-300 focus:ring-red-300 text-red-900":f,"focus:ring-primary-7 text-gray-700":!f});return u.jsxs(u.Fragment,{children:[e!==""&&u.jsx("label",{htmlFor:t,className:k("leading-6 block text-sm",r!==""&&r),children:e}),u.jsxs("div",{className:"relative overflow-x-hidden",children:[y!==null&&u.jsx("div",{className:"absolute top-2 left-3 w-full",children:y}),u.jsxs("div",{className:k("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-7 placeholder:text-gray-400 bg-white",U),children:[y!==null&&u.jsx("div",{className:"py-2","aria-hidden":"true",children:u.jsx("div",{className:"py-px",children:u.jsx("div",{className:N})})}),T&&u.jsx("textarea",{name:g,id:h,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:x,value:A,onChange:m,rows:2,readOnly:b}),u.jsx("textarea",{placeholder:l,rows:o,name:i,id:n,className:k(T||z?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",U,s!==""&&s),readOnly:d,onChange:m,value:v,"data-testid":`textarea-${n}`}),E!==null&&u.jsx("div",{className:"py-2","aria-hidden":"true",children:u.jsx("div",{className:"py-px",children:u.jsx("div",{className:S})})})]}),E!==null&&u.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:E})]}),a.length>0&&f&&u.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Cr=({children:e,data:n,className:t="",classNameTooltip:r="w-full",classNameMenu:s="",classNameMenuItems:o="",classNameContainerSearch:i="px-5",isSelectMultiple:l=!1,optionsSelect:a,propObject:d="name",propId:f="id",textNewItem:m="",defaultId:v=null,loading:h=!1,search:g=null,searchPlaceHolder:x="Buscar...",valueSearch:b=void 0,idsOptionSelect:A=null,isComponent:y,isSticky:E=!1,hiddenMenu:N=!1,id:S,onClick:T=()=>{},isRelative:z=!0,isMaxWidth:U=!1,isTag:H=!1,isClear:B=!1,clear:D=null,applyButton:G=null,applyButtonText:$="Aplicar",tagsParent:J=[],isClearTagsParent:j=!1,isReadOnly:X,isDisabledApplyButton:te=!0,isOpenMenu:w=void 0,onScroll:I=null,allValues:P=null})=>{const W=c.useRef(null),ee=c.useRef(null),[Z,ne]=c.useState(new Set),[me,ie]=c.useState(new Map);c.useEffect(()=>{A!==null&&ne(new Set(new Set(A)))},[A]),c.useEffect(()=>{j&&ie(new Map)},[j]),c.useEffect(()=>{if(J.length===0)return;const F=new Map;J.forEach(K=>F.set(K.id,K)),ie(F)},[J]),c.useEffect(()=>{B&&(ne(new Set),ie(new Map),D&&D())},[D,B]);const Q=F=>{let K=new Map(me),ae=new Set(Z),Oe=null;if(v!==null&&(F[f]===v&&(Oe=crypto.randomUUID()),Oe!==null&&(F[f]=Oe),Oe!==null&&(F[d]=F[d].replace(m,"").trim())),ae.has(F[f])?ae.delete(F[f]):ae.add(F[f]),K.has(F[f])?K.delete(F[f]):K.set(F[f],F),F[f]==="all"&&P&&Array.isArray(P)&&(ae.has(F[f])?P.forEach(Ee=>{ae.add(Ee[f]),K.set(Ee[f],Ee)}):(ae.clear(),K.clear())),F[f]!=="all"&&P){const Ee=P.find(Ge=>Ge.id==="all");ae.size===P.length-1&&ae.add("all"),ae.size===P.length-1&&K.set("all",Ee),ae.size<P.length&&ae.delete("all"),ae.size<P.length&&K.delete("all")}if(!l){const Ee=Array.from(ae),Ge=Array.from(K);Ee.shift(),Ge.shift(),ae=ae.size===2?new Set(Ee):ae,K=K.size===2?new Map(Ge):K}a(F,Array.from(ae),Oe!==null),ne(ae),ie(K)},re=F=>{T(F===!0?-1:S)},M=F=>{const K=new Set(Z),ae=new Map(me);K.delete(F[f]),ae.delete(F[f]),a(F,Array.from(K)),ne(K),ie(ae)},V=()=>{if(Z.size===0)return;const F=new Set(Z),K=new Map(me);F.clear(),K.clear(),a(null,Array.from(F)),ne(F),ie(K)};function q(F){if(typeof F!="string")return F;const K=F.toLowerCase();return K.charAt(0).toUpperCase()+K.slice(1)}const we=(F,K)=>F.description!==void 0&&F.description!==null?u.jsxs("span",{className:"flex flex-col min-w-0 w-full",children:[u.jsx("span",{className:K?"font-semibold":"text-gray-900 font-semibold",children:q(F[d])}),u.jsx("span",{className:k("block w-full truncate text-xs font-normal",!K&&"text-gray-500"),children:F.description})]}):q(F[d]);return u.jsxs(Ct,{as:"div",className:k("inline-block text-left",z&&"relative",s!==""&&s),onClick:()=>re(!0),"data-testid":`menu-${S}`,id:S,ref:W,children:[u.jsx("style",{children:`
57
57
  .w-custom {
58
58
  width: 320px;
59
59
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cemtrik-dependencies",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "dev": "vite",