lawgic-dev-kit 0.9.2 → 0.9.3
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/_virtual/index2.js +2 -2
- package/dist/_virtual/index3.js +2 -3
- package/dist/_virtual/index4.js +3 -3
- package/dist/_virtual/index5.js +3 -5
- package/dist/_virtual/index6.js +5 -2
- package/dist/components/atoms/TextInput/TextInput.js +25 -23
- package/dist/lawgic-dev-kit.umd.js +1 -1
- package/dist/node_modules/prop-types/index.js +1 -1
- package/dist/node_modules/scheduler/index.js +1 -1
- package/dist/node_modules/yup/index.esm.js +3 -3
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
package/dist/_virtual/index3.js
CHANGED
package/dist/_virtual/index4.js
CHANGED
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
var t = r();
|
|
4
|
-
const s = /* @__PURE__ */ o(t);
|
|
1
|
+
import { __require as r } from "../node_modules/tiny-case/index.js";
|
|
2
|
+
var a = r();
|
|
5
3
|
export {
|
|
6
|
-
|
|
4
|
+
a as t
|
|
7
5
|
};
|
package/dist/_virtual/index6.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { j as
|
|
2
|
-
import { useController as
|
|
1
|
+
import { j as e } from "../../../_virtual/jsx-runtime.js";
|
|
2
|
+
import { useController as y } from "../../../node_modules/react-hook-form/dist/index.esm.js";
|
|
3
3
|
import { useTheme as w } from "../../../hooks/useTheme.js";
|
|
4
4
|
const C = ({
|
|
5
5
|
label: u,
|
|
6
6
|
control: d,
|
|
7
|
-
name:
|
|
7
|
+
name: t,
|
|
8
8
|
placeholder: c,
|
|
9
9
|
className: g = "",
|
|
10
|
-
disabled:
|
|
10
|
+
disabled: l = !1,
|
|
11
11
|
leftSide: a,
|
|
12
12
|
rightSide: s,
|
|
13
13
|
translateKey: i = "",
|
|
@@ -15,37 +15,39 @@ const C = ({
|
|
|
15
15
|
}) => {
|
|
16
16
|
const {
|
|
17
17
|
field: { value: n = "", onChange: f, ref: p, onBlur: b },
|
|
18
|
-
fieldState: { error:
|
|
19
|
-
} =
|
|
20
|
-
return /* @__PURE__ */
|
|
18
|
+
fieldState: { error: r }
|
|
19
|
+
} = y({ name: t, control: d }), { t: o } = w();
|
|
20
|
+
if (!o) return /* @__PURE__ */ e.jsx(e.Fragment, {});
|
|
21
|
+
const h = o(t), m = o(i);
|
|
22
|
+
return /* @__PURE__ */ e.jsxs(
|
|
21
23
|
"label",
|
|
22
24
|
{
|
|
23
|
-
className: `flex flex-col group gap-8 select-none ${
|
|
24
|
-
htmlFor:
|
|
25
|
+
className: `flex flex-col group gap-8 select-none ${l && "cursor-not-allowed"} ${g}`,
|
|
26
|
+
htmlFor: t,
|
|
25
27
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ e.jsx(
|
|
27
29
|
"h6",
|
|
28
30
|
{
|
|
29
|
-
className: `text-gray-600 font-600 group ${
|
|
31
|
+
className: `text-gray-600 font-600 group ${r && "text-red-500!"} text-label ${l && "text-gray-300"}`,
|
|
30
32
|
children: u
|
|
31
33
|
}
|
|
32
34
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ e.jsxs(
|
|
34
36
|
"label",
|
|
35
37
|
{
|
|
36
|
-
htmlFor:
|
|
38
|
+
htmlFor: t,
|
|
37
39
|
className: `
|
|
38
40
|
flex items-center justify-between gap-8 p-16
|
|
39
41
|
|
|
40
|
-
${
|
|
42
|
+
${r && "border-red-500!"}
|
|
41
43
|
|
|
42
44
|
bg-light
|
|
43
45
|
|
|
44
46
|
w-full h-full rounded-full border
|
|
45
47
|
|
|
46
|
-
${n && !
|
|
47
|
-
${!
|
|
48
|
-
${
|
|
48
|
+
${n && !l ? "border-blue-200" : "border-blue-100"}
|
|
49
|
+
${!l && "group-hover:border-blue-300"}
|
|
50
|
+
${l && "cursor-not-allowed"}
|
|
49
51
|
|
|
50
52
|
group-focus-within:border-blue-500 transition-colors duration-200 ease-in-out
|
|
51
53
|
|
|
@@ -53,15 +55,15 @@ const C = ({
|
|
|
53
55
|
`,
|
|
54
56
|
children: [
|
|
55
57
|
a && a,
|
|
56
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ e.jsx(
|
|
57
59
|
"input",
|
|
58
60
|
{
|
|
59
|
-
id:
|
|
60
|
-
name:
|
|
61
|
-
disabled:
|
|
61
|
+
id: t,
|
|
62
|
+
name: t,
|
|
63
|
+
disabled: l,
|
|
62
64
|
placeholder: c,
|
|
63
65
|
value: n,
|
|
64
|
-
onChange: (
|
|
66
|
+
onChange: (j) => f(j.target.value),
|
|
65
67
|
onBlur: b,
|
|
66
68
|
ref: p,
|
|
67
69
|
className: "group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-hidden",
|
|
@@ -72,7 +74,7 @@ const C = ({
|
|
|
72
74
|
]
|
|
73
75
|
}
|
|
74
76
|
),
|
|
75
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ e.jsx("h4", { className: "font-500 text-label text-red-500 leading-none", children: (r == null ? void 0 : r.message) && o(r.message, { x: m || h }) })
|
|
76
78
|
]
|
|
77
79
|
}
|
|
78
80
|
);
|
|
@@ -714,7 +714,7 @@ attempted value: ${g}
|
|
|
714
714
|
group-disabled:bg-gray-500
|
|
715
715
|
`,children:[g&&g,B.jsx("input",{id:i,type:M?"text":"password",autoComplete:"off","aria-autocomplete":"none",name:i,disabled:h,placeholder:o,value:v,onChange:L=>S(L.target.value),onBlur:A,ref:E,className:"group bg-transparent w-full h-full font-600 placeholder:font-600 text-body-m disabled:text-gray-300 disabled:placeholder:text-gray-300 placeholder:text-gray-400 disabled:cursor-not-allowed overflow-visible outline-none"}),B.jsx(gn,{icon:M?uz:lz,className:"min-h-16 max-h-16 text-gray-400 hover:text-gray-500 transition-colors duration-150 cursor-pointer ease-in-out",onClick:()=>R(!M)})]}),B.jsx("h4",{className:"font-500 text-label text-red-500 leading-none",children:O&&U(O.message||"",{x:U(i)})})]})},qI=({progress:t,showPercentage:n=!1})=>{const i=Math.min(Math.max(t,0),100);return B.jsxs("div",{className:"flex items-center gap-12",children:[B.jsx("div",{className:"w-full h-8 bg-blue-100 rounded-full",children:B.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-300 ease-in-out",style:{width:`${i}%`}})}),n&&B.jsxs("span",{className:"text-sm text-gray-400 font-[500]",children:[i,"%"]})]})},II=()=>{const[t,n]=J.useState(!1),i=J.useRef(null),o=()=>{n(!0),setTimeout(()=>{var h;return(h=i.current)==null?void 0:h.focus()},100)},u=()=>{n(!1)};return B.jsx("div",{className:"relative flex items-center",children:B.jsxs("div",{className:`flex items-center justify-center bg-white shadow-md rounded-full transition-all duration-300 ease-in-out ${t?"w-[200px] h-[40px]":"size-[40px]"}`,children:[B.jsx("button",{onClick:o,className:"size-[40px] flex items-center justify-center rounded-full hover:bg-gray-100 transition-all",children:B.jsx(gn,{icon:sG})}),B.jsx("input",{ref:i,type:"text",className:`w-full outline-none bg-transparent transition-all ${t?"w-full pr-[10px]":"w-0"}`,placeholder:"Buscar...",onBlur:u,style:{border:"none",outline:"none"}})]})})},FI="w-fit transition-colors ease-in-out duration-200 flex items-center justify-center gap-12 px-24 py-7 text-base rounded-full font-[600] bg-transparent",XI={true:"bg-blue-100 text-blue-500 hover:bg-blue-100/80 active:bg-blue-100/50",false:"text-gray-800 hover:bg-blue-100/40 hover:text-blue-500 active:bg-blue-100/20 active:text-blue-500"},j8=(t=!1)=>dd(FI,XI[String(t)]),ZI=({label:t,href:n,onClick:i,active:o=!1,disabled:u=!1,className:h,icon:g})=>{const v=E=>{if(u){E.preventDefault();return}i==null||i(E)},S=`${j8(o)} ${u?"!text-gray-300 cursor-not-allowed !bg-transparent":""}`;return n?B.jsxs("a",{href:n,className:`${S} ${h||""}`,onClick:v,"aria-disabled":u,children:[g&&B.jsx(gn,{icon:g,className:pb()}),t]}):B.jsxs("button",{className:`${S} ${h||""}`,onClick:v,disabled:u,children:[g&&B.jsx(gn,{icon:g,className:pb()}),t]})},KI="w-fit transition-colors ease-in-out duration-150 flex gap-10 items-center justify-center text-xs rounded-full font-[600] bg-transparent",QI={true:"text-blue-500",false:"text-gray-800 hover:text-blue-500 active:text-blue-500"},WI="bg-transparent p-16",JI={true:"bg-blue-100 text-blue-500",false:"text-gray-800"},eF=(t=!1)=>dd(KI,QI[String(t)]),tF=(t=!1)=>dd(WI,JI[String(t)]),nF=({label:t,href:n,onClick:i,active:o=!1,disabled:u=!1,icon:h,className:g=""})=>{const v=S=>{if(u){S.preventDefault();return}i==null||i(S)};return n?B.jsxs("a",{href:n,onClick:v,className:`${eF(o)} flex flex-col items-center group ${g}`,children:[B.jsx(_2,{icon:h,variant:o?"transparent":"invisible",disabled:u,size:"sm",className:`${tF(o)} group group-hover:!text-blue-500 duration-150 group-hover:!bg-blue-100 `}),B.jsx("p",{className:"group group-hover:!text-blue-500 duration-150",children:t})]}):B.jsxs("button",{className:`${j8(o)} ${u?"!text-gray-300 cursor-not-allowed !bg-transparent":""} ${g}`,onClick:v,"aria-disabled":u,children:[B.jsx(gn,{icon:h}),t]})},aF=t=>{const{display:n,...i}=t;return n==="desktop"?B.jsx(ZI,{...i}):n==="mobile"?B.jsx(nF,{...i}):null},iF=({options:t,name:n,control:i,label:o="Select an option",placeholder:u="Type to search...",className:h="",input:g=!0})=>B.jsx(s8,{name:n,control:i,render:({field:{onChange:v,value:S},fieldState:{error:E}})=>B.jsx(rF,{options:t,value:S,onChange:v,label:o,placeholder:u,error:E==null?void 0:E.message,className:h,input:g})}),rF=({options:t,value:n,onChange:i,label:o="Select an option",placeholder:u="Type to search...",error:h,className:g="",input:v=!0})=>{const{t:S}=ri(),[E,A]=J.useState(!1),[O,M]=J.useState(""),[R,U]=J.useState(n||null),L=J.useRef(null),H=J.useRef(null),{x:V,y:I,strategy:G,refs:te,context:Y}=C2({open:E,onOpenChange:A,middleware:[x2(8),E2(),T2({padding:8}),ew({apply({availableHeight:F,elements:ne}){Object.assign(ne.floating.style,{maxHeight:`${Math.min(F-10,300)}px`})},padding:8}),tw({element:H})],placement:"bottom-start",whileElementsMounted:v2}),oe=w2(Y),me=O2(Y),{getReferenceProps:ge,getFloatingProps:be}=M2([oe,me]),{isMounted:He,styles:je}=D2(Y,{duration:{open:200,close:150},initial:{opacity:0,transform:"translateY(-4px)"}}),Pe=(()=>{const F=Array.isArray(t)?t:[];if(!O.trim())return F;const ne=O.toLowerCase();return F.filter(le=>{const Re=le.label.toLowerCase(),X=le.key.toLowerCase();return Re.includes(ne)||X.includes(ne)})})(),Qe=F=>{U(F),A(!1),M(""),i(F)},Ze=()=>{A(!E),!E&&L.current&&setTimeout(()=>{var F;return(F=L.current)==null?void 0:F.focus()},100)};J.useEffect(()=>{U(n)},[n]);const Ge=ge({onClick:Ze});return B.jsxs("div",{className:`w-full relative flex flex-col gap-8 ${g}`,children:[B.jsx("label",{className:`text-gray-600 font-600 group ${h&&"!text-red-500"} text-label`,children:o}),B.jsxs("div",{ref:te.setReference,className:`flex items-center justify-between bg-light rounded-full p-16 cursor-pointer
|
|
716
716
|
border transition-all duration-200 hover:border-blue-400
|
|
717
|
-
${h&&"border-red-500 hover:border-red-600"} ${He?"border-blue-400":"border-blue-100"}`,...Ge,children:[R?B.jsx("div",{className:"flex items-center w-full",children:B.jsx("span",{className:"flex-grow",children:S(R.label)})}):B.jsx("span",{className:"text-gray-500",children:u}),B.jsx("svg",{className:`w-16 h-16 transition-transform ${E?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:B.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),h&&B.jsx("p",{className:"mt-1 text-sm text-red-600",children:h}),He&&B.jsxs("div",{ref:te.setFloating,style:{position:G,top:I??0,left:V??0,...je},className:"z-10 w-full bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto",...be(),children:[v&&B.jsx("div",{className:"sticky top-0 bg-white p-2 z-20",children:B.jsx("input",{ref:L,type:"text",className:"w-full p-16",placeholder:"Search...",value:O,onChange:F=>M(F.target.value),onClick:F=>F.stopPropagation(),autoFocus:!0})}),B.jsx("div",{className:"",children:Pe.length>0?B.jsx("ul",{children:Pe.map((F,ne)=>B.jsx("li",{className:"flex items-center justify-between px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:le=>{le.stopPropagation(),Qe(F)},children:B.jsx("span",{children:S(F.label)})},`${F.key}-${ne}`))}):B.jsx("div",{className:"px-3 py-2 text-gray-500",children:"No options found"})})]})]})},lF="flex w-full h-full gap-12 px-10 py-6 items-center justify-center",oF={default:"flex-row rounded-full text-blue-500",underline:"flex-col border-b-[1.3px] px-24 pb-16 text-gray-700"},sF={true:"text-blue-500 border-b-blue-500",false:"text-gray-700 border-b-gray-700"},uF=(t="underline",n=!1)=>dd(lF,oF[t],sF[String(n)]),$8=({label:t,icon:n,isSelected:i,onClick:o,variant:u="default",direction:h="row"})=>B.jsxs("button",{className:`${uF(u,i)} w-full cursor-pointer transition-all duration-200 ${h==="row"&&"flex-row!"}`,onClick:o,children:[n&&B.jsx(gn,{icon:n,className:`${i?"text-blue-500":"text-gray-500"} w-20 h-20`}),B.jsx("span",{className:"text-lg font-500",children:t})]}),cF="transition-colors ease-in-out duration-200 flex items-center justify-center text-body-m rounded-full w-fit font-[600] leading-normal disabled:cursor-not-allowed disabled:text-gray-300",fF={blue:"text-blue-500 hover:text-blue-600 active:text-blue-700",aqua:"text-aqua-500 hover:text-aqua-600 active:text-aqua-700",red:"text-red-500 hover:text-red-600 active:text-red-700",gray:"text-gray-500 hover:text-gray-600 active:text-gray-700"},dF=(t="blue")=>dd(cF,fF[t]),H8=({color:t,children:n,className:i,...o})=>{const{defaultColorScheme:u}=ri(),h=t||u;return B.jsx("button",{type:"button",className:dF(h)+" "+i,...o,children:n})},hF=({label:t,control:n,name:i,placeholder:o,className:u="",disabled:h=!1,leftSide:g,rightSide:v,translateKey:S="",...E})=>{const{field:{value:A="",onChange:O,ref:M,onBlur:R},fieldState:{error:U}}=Wy({name:i,control:n}),{t:L}=ri(),H=L(i),V=L(S);return B.jsxs("label",{className:`flex flex-col group gap-8 select-none ${h&&"cursor-not-allowed"} ${u}`,htmlFor:i,children:[B.jsx("h6",{className:`text-gray-600 font-600 group ${U&&"text-red-500!"} text-label ${h&&"text-gray-300"}`,children:t}),B.jsxs("label",{htmlFor:i,className:`
|
|
717
|
+
${h&&"border-red-500 hover:border-red-600"} ${He?"border-blue-400":"border-blue-100"}`,...Ge,children:[R?B.jsx("div",{className:"flex items-center w-full",children:B.jsx("span",{className:"flex-grow",children:S(R.label)})}):B.jsx("span",{className:"text-gray-500",children:u}),B.jsx("svg",{className:`w-16 h-16 transition-transform ${E?"transform rotate-180":""}`,fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:B.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M19 9l-7 7-7-7"})})]}),h&&B.jsx("p",{className:"mt-1 text-sm text-red-600",children:h}),He&&B.jsxs("div",{ref:te.setFloating,style:{position:G,top:I??0,left:V??0,...je},className:"z-10 w-full bg-white border border-blue-400 rounded-3xl shadow-lg overflow-auto",...be(),children:[v&&B.jsx("div",{className:"sticky top-0 bg-white p-2 z-20",children:B.jsx("input",{ref:L,type:"text",className:"w-full p-16",placeholder:"Search...",value:O,onChange:F=>M(F.target.value),onClick:F=>F.stopPropagation(),autoFocus:!0})}),B.jsx("div",{className:"",children:Pe.length>0?B.jsx("ul",{children:Pe.map((F,ne)=>B.jsx("li",{className:"flex items-center justify-between px-16 py-8 transition-all duration-200 hover:bg-blue-100/50 cursor-pointer",onClick:le=>{le.stopPropagation(),Qe(F)},children:B.jsx("span",{children:S(F.label)})},`${F.key}-${ne}`))}):B.jsx("div",{className:"px-3 py-2 text-gray-500",children:"No options found"})})]})]})},lF="flex w-full h-full gap-12 px-10 py-6 items-center justify-center",oF={default:"flex-row rounded-full text-blue-500",underline:"flex-col border-b-[1.3px] px-24 pb-16 text-gray-700"},sF={true:"text-blue-500 border-b-blue-500",false:"text-gray-700 border-b-gray-700"},uF=(t="underline",n=!1)=>dd(lF,oF[t],sF[String(n)]),$8=({label:t,icon:n,isSelected:i,onClick:o,variant:u="default",direction:h="row"})=>B.jsxs("button",{className:`${uF(u,i)} w-full cursor-pointer transition-all duration-200 ${h==="row"&&"flex-row!"}`,onClick:o,children:[n&&B.jsx(gn,{icon:n,className:`${i?"text-blue-500":"text-gray-500"} w-20 h-20`}),B.jsx("span",{className:"text-lg font-500",children:t})]}),cF="transition-colors ease-in-out duration-200 flex items-center justify-center text-body-m rounded-full w-fit font-[600] leading-normal disabled:cursor-not-allowed disabled:text-gray-300",fF={blue:"text-blue-500 hover:text-blue-600 active:text-blue-700",aqua:"text-aqua-500 hover:text-aqua-600 active:text-aqua-700",red:"text-red-500 hover:text-red-600 active:text-red-700",gray:"text-gray-500 hover:text-gray-600 active:text-gray-700"},dF=(t="blue")=>dd(cF,fF[t]),H8=({color:t,children:n,className:i,...o})=>{const{defaultColorScheme:u}=ri(),h=t||u;return B.jsx("button",{type:"button",className:dF(h)+" "+i,...o,children:n})},hF=({label:t,control:n,name:i,placeholder:o,className:u="",disabled:h=!1,leftSide:g,rightSide:v,translateKey:S="",...E})=>{const{field:{value:A="",onChange:O,ref:M,onBlur:R},fieldState:{error:U}}=Wy({name:i,control:n}),{t:L}=ri();if(!L)return B.jsx(B.Fragment,{});const H=L(i),V=L(S);return B.jsxs("label",{className:`flex flex-col group gap-8 select-none ${h&&"cursor-not-allowed"} ${u}`,htmlFor:i,children:[B.jsx("h6",{className:`text-gray-600 font-600 group ${U&&"text-red-500!"} text-label ${h&&"text-gray-300"}`,children:t}),B.jsxs("label",{htmlFor:i,className:`
|
|
718
718
|
flex items-center justify-between gap-8 p-16
|
|
719
719
|
|
|
720
720
|
${U&&"border-red-500!"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as r } from "../../_virtual/
|
|
1
|
+
import { __module as r } from "../../_virtual/index3.js";
|
|
2
2
|
import { __require as s } from "./node_modules/react-is/index.js";
|
|
3
3
|
import { __require as t } from "./factoryWithTypeCheckers.js";
|
|
4
4
|
import { __require as p } from "./factoryWithThrowingShims.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { p as v } from "../../_virtual/
|
|
2
|
-
import { t as U } from "../../_virtual/
|
|
3
|
-
import oe from "../../_virtual/
|
|
1
|
+
import { p as v } from "../../_virtual/index4.js";
|
|
2
|
+
import { t as U } from "../../_virtual/index5.js";
|
|
3
|
+
import oe from "../../_virtual/index6.js";
|
|
4
4
|
const ce = Object.prototype.toString, he = Error.prototype.toString, fe = RegExp.prototype.toString, de = typeof Symbol < "u" ? Symbol.prototype.toString : () => "", pe = /^Symbol\((.*)\)(.*)$/;
|
|
5
5
|
function me(n) {
|
|
6
6
|
return n != +n ? "NaN" : n === 0 && 1 / n < 0 ? "-0" : "" + n;
|