@processhub-lib/react 1.0.1 → 1.0.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/README.md +93 -0
- package/package.json +5 -2
- package/src/scripts/generate-endpoints.ts +184 -0
- package/src/ui/Select/index.tsx +3 -2
- package/src/utils/applyMask.tsx +49 -0
- package/src/utils/formatar.tsx +173 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/isDocumento.tsx +46 -0
- package/dist/context/ThemeContext.d.ts +0 -22
- package/dist/index-DN3Jte8S.cjs +0 -30
- package/dist/index-DRwba4Gg.js +0 -1170
- package/dist/index.cjs.js +0 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.es.js +0 -10
- package/dist/style.css +0 -1
- package/dist/ui/Button/colors.d.ts +0 -162
- package/dist/ui/Button/index.d.ts +0 -3
- package/dist/ui/Button/types/button.d.ts +0 -16
- package/dist/ui/Input/index.d.ts +0 -3
- package/dist/ui/Input/types/input.d.ts +0 -10
- package/dist/ui/Select/index.d.ts +0 -3
- package/dist/ui/Select/types/select.d.ts +0 -16
- package/dist/ui/index.d.ts +0 -3
- package/dist/ui.cjs.js +0 -1
- package/dist/ui.d.ts +0 -1
- package/dist/ui.es.js +0 -6
- package/dist/utils/classnames.d.ts +0 -16
- package/dist/utils/index.d.ts +0 -1
- package/dist/utils.cjs.js +0 -1
- package/dist/utils.d.ts +0 -1
- package/dist/utils.es.js +0 -29
package/dist/index-DN3Jte8S.cjs
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";const P=require("react"),I=require("./utils.cjs.js");function jr(n){const a=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(n){for(const g in n)if(g!=="default"){const f=Object.getOwnPropertyDescriptor(n,g);Object.defineProperty(a,g,f.get?f:{enumerable:!0,get:()=>n[g]})}}return a.default=n,Object.freeze(a)}const l=jr(P);var de={exports:{}},H={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var Ie;function Cr(){if(Ie)return H;Ie=1;var n=P,a=Symbol.for("react.element"),g=Symbol.for("react.fragment"),f=Object.prototype.hasOwnProperty,p=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_={key:!0,ref:!0,__self:!0,__source:!0};function S(x,c,E){var u,w={},T=null,k=null;E!==void 0&&(T=""+E),c.key!==void 0&&(T=""+c.key),c.ref!==void 0&&(k=c.ref);for(u in c)f.call(c,u)&&!_.hasOwnProperty(u)&&(w[u]=c[u]);if(x&&x.defaultProps)for(u in c=x.defaultProps,c)w[u]===void 0&&(w[u]=c[u]);return{$$typeof:a,type:x,key:T,ref:k,props:w,_owner:p.current}}return H.Fragment=g,H.jsx=S,H.jsxs=S,H}var B={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Ve;function Sr(){return Ve||(Ve=1,process.env.NODE_ENV!=="production"&&function(){var n=P,a=Symbol.for("react.element"),g=Symbol.for("react.portal"),f=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),x=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),k=Symbol.for("react.offscreen"),M=Symbol.iterator,q="@@iterator";function z(e){if(e===null||typeof e!="object")return null;var r=M&&e[M]||e[q];return typeof r=="function"?r:null}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function y(e){{for(var r=arguments.length,t=new Array(r>1?r-1:0),o=1;o<r;o++)t[o-1]=arguments[o];J("error",e,t)}}function J(e,r,t){{var o=L.ReactDebugCurrentFrame,d=o.getStackAddendum();d!==""&&(r+="%s",t=t.concat([d]));var v=t.map(function(s){return String(s)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var ee=!1,U=!1,j=!1,$=!1,Je=!1,ve;ve=Symbol.for("react.module.reference");function Ke(e){return!!(typeof e=="string"||typeof e=="function"||e===f||e===_||Je||e===p||e===E||e===u||$||e===k||ee||U||j||typeof e=="object"&&e!==null&&(e.$$typeof===T||e.$$typeof===w||e.$$typeof===S||e.$$typeof===x||e.$$typeof===c||e.$$typeof===ve||e.getModuleId!==void 0))}function Ge(e,r,t){var o=e.displayName;if(o)return o;var d=r.displayName||r.name||"";return d!==""?t+"("+d+")":t}function ge(e){return e.displayName||"Context"}function F(e){if(e==null)return null;if(typeof e.tag=="number"&&y("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case f:return"Fragment";case g:return"Portal";case _:return"Profiler";case p:return"StrictMode";case E:return"Suspense";case u:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case x:var r=e;return ge(r)+".Consumer";case S:var t=e;return ge(t._context)+".Provider";case c:return Ge(e,e.render,"ForwardRef");case w:var o=e.displayName||null;return o!==null?o:F(e.type)||"Memo";case T:{var d=e,v=d._payload,s=d._init;try{return F(s(v))}catch{return null}}}return null}var D=Object.assign,W=0,be,he,pe,me,xe,ye,Ee;function we(){}we.__reactDisabledLog=!0;function Xe(){{if(W===0){be=console.log,he=console.info,pe=console.warn,me=console.error,xe=console.group,ye=console.groupCollapsed,Ee=console.groupEnd;var e={configurable:!0,enumerable:!0,value:we,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Qe(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:D({},e,{value:be}),info:D({},e,{value:he}),warn:D({},e,{value:pe}),error:D({},e,{value:me}),group:D({},e,{value:xe}),groupCollapsed:D({},e,{value:ye}),groupEnd:D({},e,{value:Ee})})}W<0&&y("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var re=L.ReactCurrentDispatcher,te;function K(e,r,t){{if(te===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);te=o&&o[1]||""}return`
|
|
18
|
-
`+te+e}}var ne=!1,G;{var er=typeof WeakMap=="function"?WeakMap:Map;G=new er}function Re(e,r){if(!e||ne)return"";{var t=G.get(e);if(t!==void 0)return t}var o;ne=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=re.current,re.current=null,Xe();try{if(r){var s=function(){throw Error()};if(Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(A){o=A}Reflect.construct(e,[],s)}else{try{s.call()}catch(A){o=A}e.call(s.prototype)}}else{try{throw Error()}catch(A){o=A}e()}}catch(A){if(A&&o&&typeof A.stack=="string"){for(var i=A.stack.split(`
|
|
19
|
-
`),C=o.stack.split(`
|
|
20
|
-
`),h=i.length-1,m=C.length-1;h>=1&&m>=0&&i[h]!==C[m];)m--;for(;h>=1&&m>=0;h--,m--)if(i[h]!==C[m]){if(h!==1||m!==1)do if(h--,m--,m<0||i[h]!==C[m]){var O=`
|
|
21
|
-
`+i[h].replace(" at new "," at ");return e.displayName&&O.includes("<anonymous>")&&(O=O.replace("<anonymous>",e.displayName)),typeof e=="function"&&G.set(e,O),O}while(h>=1&&m>=0);break}}}finally{ne=!1,re.current=v,Qe(),Error.prepareStackTrace=d}var Z=e?e.displayName||e.name:"",N=Z?K(Z):"";return typeof e=="function"&&G.set(e,N),N}function rr(e,r,t){return Re(e,!1)}function tr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function X(e,r,t){if(e==null)return"";if(typeof e=="function")return Re(e,tr(e));if(typeof e=="string")return K(e);switch(e){case E:return K("Suspense");case u:return K("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case c:return rr(e.render);case w:return X(e.type,r,t);case T:{var o=e,d=o._payload,v=o._init;try{return X(v(d),r,t)}catch{}}}return""}var Y=Object.prototype.hasOwnProperty,_e={},je=L.ReactDebugCurrentFrame;function Q(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);je.setExtraStackFrame(t)}else je.setExtraStackFrame(null)}function nr(e,r,t,o,d){{var v=Function.call.bind(Y);for(var s in e)if(v(e,s)){var i=void 0;try{if(typeof e[s]!="function"){var C=Error((o||"React class")+": "+t+" type `"+s+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[s]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}i=e[s](r,s,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){i=h}i&&!(i instanceof Error)&&(Q(d),y("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",o||"React class",t,s,typeof i),Q(null)),i instanceof Error&&!(i.message in _e)&&(_e[i.message]=!0,Q(d),y("Failed %s type: %s",t,i.message),Q(null))}}}var ar=Array.isArray;function ae(e){return ar(e)}function or(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,t=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return t}}function lr(e){try{return Ce(e),!1}catch{return!0}}function Ce(e){return""+e}function Se(e){if(lr(e))return y("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",or(e)),Ce(e)}var Te=L.ReactCurrentOwner,ir={key:!0,ref:!0,__self:!0,__source:!0},Ae,Oe;function sr(e){if(Y.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function ur(e){if(Y.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function cr(e,r){typeof e.ref=="string"&&Te.current}function dr(e,r){{var t=function(){Ae||(Ae=!0,y("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"key",{get:t,configurable:!0})}}function fr(e,r){{var t=function(){Oe||(Oe=!0,y("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",r))};t.isReactWarning=!0,Object.defineProperty(e,"ref",{get:t,configurable:!0})}}var vr=function(e,r,t,o,d,v,s){var i={$$typeof:a,type:e,key:r,ref:t,props:s,_owner:v};return i._store={},Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function gr(e,r,t,o,d){{var v,s={},i=null,C=null;t!==void 0&&(Se(t),i=""+t),ur(r)&&(Se(r.key),i=""+r.key),sr(r)&&(C=r.ref,cr(r,d));for(v in r)Y.call(r,v)&&!ir.hasOwnProperty(v)&&(s[v]=r[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)s[v]===void 0&&(s[v]=h[v])}if(i||C){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;i&&dr(s,m),C&&fr(s,m)}return vr(e,i,C,d,o,Te.current,s)}}var oe=L.ReactCurrentOwner,Pe=L.ReactDebugCurrentFrame;function V(e){if(e){var r=e._owner,t=X(e.type,e._source,r?r.type:null);Pe.setExtraStackFrame(t)}else Pe.setExtraStackFrame(null)}var le;le=!1;function ie(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function ke(){{if(oe.current){var e=F(oe.current.type);if(e)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function br(e){return""}var Le={};function hr(e){{var r=ke();if(!r){var t=typeof e=="string"?e:e.displayName||e.name;t&&(r=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+t+">.")}return r}}function Fe(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var t=hr(r);if(Le[t])return;Le[t]=!0;var o="";e&&e._owner&&e._owner!==oe.current&&(o=" It was passed a child from "+F(e._owner.type)+"."),V(e),y('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',t,o),V(null)}}function Me(e,r){{if(typeof e!="object")return;if(ae(e))for(var t=0;t<e.length;t++){var o=e[t];ie(o)&&Fe(o,r)}else if(ie(e))e._store&&(e._store.validated=!0);else if(e){var d=z(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),s;!(s=v.next()).done;)ie(s.value)&&Fe(s.value,r)}}}function pr(e){{var r=e.type;if(r==null||typeof r=="string")return;var t;if(typeof r=="function")t=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===c||r.$$typeof===w))t=r.propTypes;else return;if(t){var o=F(r);nr(t,e.props,"prop",o,e)}else if(r.PropTypes!==void 0&&!le){le=!0;var d=F(r);y("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&y("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function mr(e){{for(var r=Object.keys(e.props),t=0;t<r.length;t++){var o=r[t];if(o!=="children"&&o!=="key"){V(e),y("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",o),V(null);break}}e.ref!==null&&(V(e),y("Invalid attribute `ref` supplied to `React.Fragment`."),V(null))}}var De={};function Ne(e,r,t,o,d,v){{var s=Ke(e);if(!s){var i="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var C=br();C?i+=C:i+=ke();var h;e===null?h="null":ae(e)?h="array":e!==void 0&&e.$$typeof===a?(h="<"+(F(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):h=typeof e,y("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",h,i)}var m=gr(e,r,t,d,v);if(m==null)return m;if(s){var O=r.children;if(O!==void 0)if(o)if(ae(O)){for(var Z=0;Z<O.length;Z++)Me(O[Z],e);Object.freeze&&Object.freeze(O)}else y("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else Me(O,e)}if(Y.call(r,"key")){var N=F(e),A=Object.keys(r).filter(function(_r){return _r!=="key"}),se=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!De[N+se]){var Rr=A.length>0?"{"+A.join(": ..., ")+": ...}":"{}";y(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
-
let props = %s;
|
|
27
|
-
<%s {...props} />
|
|
28
|
-
React keys must be passed directly to JSX without using spread:
|
|
29
|
-
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,se,N,Rr,N),De[N+se]=!0}}return e===f?mr(m):pr(m),m}}function xr(e,r,t){return Ne(e,r,t,!0)}function yr(e,r,t){return Ne(e,r,t,!1)}var Er=yr,wr=xr;B.Fragment=f,B.jsx=Er,B.jsxs=wr}()),B}process.env.NODE_ENV==="production"?de.exports=Cr():de.exports=Sr();var b=de.exports;const $e={green:{solid:{bg:"bg-green-500",hover:"hover:bg-green-600 hover:text-white",text:"text-white",border:"border-green-500"},outline:{bg:"bg-transparent",hover:"hover:bg-green-600 hover:text-white",text:"text-green-600",border:"border-green-500"},ghost:{bg:"bg-transparent",hover:"hover:bg-green-600 hover:text-white",text:"text-green-600",border:"border-transparent"}},blue:{solid:{bg:"bg-blue-500",hover:"hover:bg-blue-600 hover:text-white",text:"text-white",border:"border-blue-500"},outline:{bg:"bg-transparent",hover:"hover:bg-blue-500 hover:text-white",text:"text-blue-600",border:"border-blue-500"},ghost:{bg:"bg-transparent",hover:"hover:bg-blue-500 hover:text-white",text:"text-blue-600",border:"border-transparent"}},red:{solid:{bg:"bg-red-500",hover:"hover:bg-red-600 hover:text-white",text:"text-white",border:"border-red-500"},outline:{bg:"bg-transparent",hover:"hover:bg-red-500 hover:text-white",text:"text-red-600",border:"border-red-500"},ghost:{bg:"bg-transparent",hover:"hover:bg-red-500 hover:text-white",text:"text-red-600",border:"border-transparent"}},yellow:{solid:{bg:"bg-yellow-500",hover:"hover:bg-yellow-600 hover:text-black",text:"text-black",border:"border-yellow-500"},outline:{bg:"bg-transparent",hover:"hover:bg-yellow-500 hover:text-white",text:"text-yellow-600",border:"border-yellow-500"},ghost:{bg:"bg-transparent",hover:"hover:bg-yellow-500 hover:text-white",text:"text-yellow-600",border:"border-transparent"}},primary:{solid:{bg:"bg-primary",hover:"hover:bg-primary-hover hover:text-foreground",text:"text-foreground",border:"border-primary"},outline:{bg:"bg-transparent",hover:"hover:bg-primary hover:text-foreground",text:"text-primary",border:"border-primary"},ghost:{bg:"bg-transparent",hover:"hover:bg-primary hover:text-foreground",text:"text-primary",border:"border-transparent"}},secondary:{solid:{bg:"bg-secondary",hover:"hover:bg-secondary/80 hover:text-secondary-foreground",text:"text-secondary-foreground",border:"border-secondary"},outline:{bg:"bg-transparent",hover:"hover:bg-secondary hover:text-secondary-foreground",text:"text-secondary",border:"border-secondary"},ghost:{bg:"bg-transparent",hover:"hover:bg-secondary hover:text-secondary-foreground",text:"text-secondary",border:"border-transparent"}},destructive:{solid:{bg:"bg-destructive",hover:"hover:bg-destructive/90 hover:text-destructive-foreground",text:"text-destructive-foreground",border:"border-destructive"},outline:{bg:"bg-transparent",hover:"hover:bg-destructive hover:text-destructive-foreground",text:"text-destructive",border:"border-destructive"},ghost:{bg:"bg-transparent",hover:"hover:bg-destructive hover:text-destructive-foreground",text:"text-destructive",border:"border-transparent"}},card:{solid:{bg:"bg-card",hover:"hover:bg-accent hover:text-card-foreground",text:"text-card-foreground",border:"border-border"},outline:{bg:"bg-transparent",hover:"hover:bg-accent hover:text-card-foreground",text:"text-card-foreground",border:"border-border"},ghost:{bg:"bg-transparent",hover:"hover:bg-accent hover:text-card-foreground",text:"text-card-foreground",border:"border-transparent"}}},We=P.createContext($e),Ye=()=>{const n=P.useContext(We);if(!n)throw new Error("useTheme must be used within a ProcessHubProvider");return n},Tr=({children:n,theme:a={}})=>{const g={...$e,...a};return b.jsx(We.Provider,{value:g,children:n})};function He({title:n,icon:a,positionIcon:g,color:f="green",variant:p="solid",disable:_=!1,className:S,type:x="button",onClick:c=()=>{}}){var T;const E=Ye(),u=((T=E[f])==null?void 0:T[p])||E.green.solid,w=I.classnames("cursor-pointer flex items-center justify-center gap-2 px-4 py-2 rounded-lg transition-colors shadow-sm font-medium text-sm border",u.bg,u.hover,u.text,u.border,{"opacity-50 cursor-not-allowed":_},S);return b.jsxs("button",{type:x,onClick:k=>!_&&(c==null?void 0:c(k)),disabled:_,className:w,children:[g==="left"&&a,n&&b.jsx("span",{className:"first-letter:uppercase",children:n}),g==="right"&&a]})}function Be({field:n,title:a,id:g,type:f,placeholder:p,className:_,value:S,iconPosition:x,icon:c,error:E,...u}){return b.jsxs("div",{className:"flex flex-col gap-2",children:[a&&b.jsxs("label",{htmlFor:g,className:I.classnames("block text-md font-medium text-foreground",{"text-red-700":E}),children:[u.required&&b.jsx("span",{className:"text-red-500",children:"* "}),a,":"]}),b.jsxs("div",{className:I.classnames("flex items-center justify-between border border-border text-foreground text-sm rounded-lg w-full",{"text-red-500 placeholder-red-500 border-red-500 focus:ring-red-500 focus:border-red-500":E,"p-2.5":c,"bg-input cursor-pointer":!u.disabled,"bg-gray-400/40 cursor-not-allowed":u.disabled}),children:[x==="left"&&c,b.jsx("input",{type:f,id:g,name:String(n),value:S,placeholder:p,className:I.classnames("bg-transparent border-none text-foreground text-sm focus:outline-none w-full",{"ml-3":x==="left","p-2.5":!c,"cursor-pointer":!u.disabled,"cursor-not-allowed":u.disabled,className:_}),onChange:u.onChange,...u}),x==="right"&&c]}),E&&b.jsx("div",{className:"mt-2",children:b.jsx("p",{className:"text-sm text-red-600 dark:text-red-500",children:E})})]})}const R=[];for(let n=0;n<256;++n)R.push((n+256).toString(16).slice(1));function Ar(n,a=0){return(R[n[a+0]]+R[n[a+1]]+R[n[a+2]]+R[n[a+3]]+"-"+R[n[a+4]]+R[n[a+5]]+"-"+R[n[a+6]]+R[n[a+7]]+"-"+R[n[a+8]]+R[n[a+9]]+"-"+R[n[a+10]]+R[n[a+11]]+R[n[a+12]]+R[n[a+13]]+R[n[a+14]]+R[n[a+15]]).toLowerCase()}let ue;const Or=new Uint8Array(16);function Pr(){if(!ue){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");ue=crypto.getRandomValues.bind(crypto)}return ue(Or)}const kr=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Ze={randomUUID:kr};function Lr(n,a,g){var p;n=n||{};const f=n.random??((p=n.rng)==null?void 0:p.call(n))??Pr();if(f.length<16)throw new Error("Random bytes length must be >= 16");return f[6]=f[6]&15|64,f[8]=f[8]&63|128,Ar(f)}function Ue(n,a,g){return Ze.randomUUID&&!n?Ze.randomUUID():Lr(n)}const Fr=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M237.24,213.21C216.12,203,204,180.64,204,152V134.73a19.94,19.94,0,0,0-12.62-18.59l-24.86-9.81a4,4,0,0,1-2.26-5.14l21.33-53A32,32,0,0,0,167.17,6,32.13,32.13,0,0,0,126.25,24.2l-.07.18-21,53.09a3.94,3.94,0,0,1-2.14,2.2,3.89,3.89,0,0,1-3,.06L74.6,69.43A19.89,19.89,0,0,0,52.87,74C31.06,96.43,20,122.68,20,152a115.46,115.46,0,0,0,32.29,80.3A12,12,0,0,0,61,236H232a12,12,0,0,0,5.24-22.79ZM68.19,92.73,91.06,102A28,28,0,0,0,127.5,86.31l20.95-53a8.32,8.32,0,0,1,10.33-4.81,8,8,0,0,1,4.61,10.57,1.17,1.17,0,0,0,0,.11L142,92.29a28.05,28.05,0,0,0,15.68,36.33L180,137.45V152c0,1,0,2.07.05,3.1l-122.44-49A101.91,101.91,0,0,1,68.19,92.73ZM116.74,212a83.73,83.73,0,0,1-22.09-39,12,12,0,0,0-23.25,6,110.27,110.27,0,0,0,14.49,33H66.25A91.53,91.53,0,0,1,44,152a84,84,0,0,1,3.41-24.11l136.67,54.66A86.58,86.58,0,0,0,198.66,212Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M192.8,165.12,43.93,105.57A110.88,110.88,0,0,1,61.47,82.38a8,8,0,0,1,8.67-1.81L95.52,90.85a16,16,0,0,0,20.82-9l21-53.1c4.15-10,15.47-15.33,25.63-11.53a20,20,0,0,1,11.51,26.39L153.13,96.71a16,16,0,0,0,8.93,20.75L187,127.3a8,8,0,0,1,5,7.43V152A104.58,104.58,0,0,0,192.8,165.12Z",opacity:"0.2"}),l.createElement("path",{d:"M235.5,216.81c-22.56-11-35.5-34.58-35.5-64.8V134.73a15.94,15.94,0,0,0-10.09-14.87L165,110a8,8,0,0,1-4.48-10.34l21.32-53a28,28,0,0,0-16.1-37,28.14,28.14,0,0,0-35.82,16,.61.61,0,0,0,0,.12L108.9,79a8,8,0,0,1-10.37,4.49L73.11,73.14A15.89,15.89,0,0,0,55.74,76.8C34.68,98.45,24,123.75,24,152a111.45,111.45,0,0,0,31.18,77.53A8,8,0,0,0,61,232H232a8,8,0,0,0,3.5-15.19ZM67.14,88l25.41,10.3a24,24,0,0,0,31.23-13.45l21-53c2.56-6.11,9.47-9.27,15.43-7a12,12,0,0,1,6.88,15.92L145.69,93.76a24,24,0,0,0,13.43,31.14L184,134.73V152c0,.33,0,.66,0,1L55.77,101.71A108.84,108.84,0,0,1,67.14,88Zm48,128a87.53,87.53,0,0,1-24.34-42,8,8,0,0,0-15.49,4,105.16,105.16,0,0,0,18.36,38H64.44A95.54,95.54,0,0,1,40,152a85.9,85.9,0,0,1,7.73-36.29l137.8,55.12c3,18,10.56,33.48,21.89,45.16Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M235.29,216.7C212.86,205.69,200,182.12,200,152V134.69a15.94,15.94,0,0,0-10.09-14.87l-28.65-11.46A8,8,0,0,1,156.79,98l22.32-56.67C184,28.79,178,14.21,165.34,9.51a24,24,0,0,0-30.7,13.71L112.25,80.08a8,8,0,0,1-10.41,4.5L73.11,73.08a15.91,15.91,0,0,0-17.38,3.66C34.68,98.4,24,123.71,24,152a111.53,111.53,0,0,0,31.15,77.53A8.06,8.06,0,0,0,61,232H232a8,8,0,0,0,8-7.51A8.21,8.21,0,0,0,235.29,216.7ZM115.11,216a87.52,87.52,0,0,1-24.26-41.71,8.21,8.21,0,0,0-9.25-6.18A8,8,0,0,0,75.28,178a105.33,105.33,0,0,0,18.36,38H64.44A95.62,95.62,0,0,1,40,152a85.92,85.92,0,0,1,7.73-36.3l137.8,55.13c3,18.06,10.55,33.5,21.89,45.19Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M234.62,218.6C211.35,207.29,198,183,198,152V134.7a14,14,0,0,0-8.82-13l-24.89-9.83a10,10,0,0,1-5.59-13L180,45.9a26,26,0,0,0-15-34.33c-12.95-4.83-27.88,1.84-33.31,15l-21,53.11a10,10,0,0,1-13,5.61L72.37,75a13.9,13.9,0,0,0-15.2,3.19C36.49,99.42,26,124.26,26,152a109.53,109.53,0,0,0,30.62,76.16A6,6,0,0,0,61,230H232a6,6,0,0,0,2.62-11.4ZM65.77,86.52a2,2,0,0,1,2.12-.43l25.4,10.29a22,22,0,0,0,28.63-12.32l21-53c3-7.13,11-10.81,18-8.21a14,14,0,0,1,8,18.54l-21.36,53.1A22.05,22.05,0,0,0,159.86,123l24.88,9.83A2,2,0,0,1,186,134.7V152c0,1.34,0,2.65.08,4L52.74,102.61A110.07,110.07,0,0,1,65.77,86.52ZM114.33,218a89.6,89.6,0,0,1-25.5-43.5,6,6,0,1,0-11.62,3A102.87,102.87,0,0,0,97.81,218H63.56A97.56,97.56,0,0,1,38,152a87.42,87.42,0,0,1,8.71-38.86L187.35,169.4c3.15,19.92,11.77,36.66,25,48.6Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M235.5,216.81c-22.56-11-35.5-34.58-35.5-64.8V134.73a15.94,15.94,0,0,0-10.09-14.87L165,110a8,8,0,0,1-4.48-10.34l21.32-53a28,28,0,0,0-16.1-37,28.14,28.14,0,0,0-35.82,16,.61.61,0,0,0,0,.12L108.9,79a8,8,0,0,1-10.37,4.49L73.11,73.14A15.89,15.89,0,0,0,55.74,76.8C34.68,98.45,24,123.75,24,152a111.45,111.45,0,0,0,31.18,77.53A8,8,0,0,0,61,232H232a8,8,0,0,0,3.5-15.19ZM67.14,88l25.41,10.3a24,24,0,0,0,31.23-13.45l21-53c2.56-6.11,9.47-9.27,15.43-7a12,12,0,0,1,6.88,15.92L145.69,93.76a24,24,0,0,0,13.43,31.14L184,134.73V152c0,.33,0,.66,0,1L55.77,101.71A108.84,108.84,0,0,1,67.14,88Zm48,128a87.53,87.53,0,0,1-24.34-42,8,8,0,0,0-15.49,4,105.16,105.16,0,0,0,18.36,38H64.44A95.54,95.54,0,0,1,40,152a85.9,85.9,0,0,1,7.73-36.29l137.8,55.12c3,18,10.56,33.48,21.89,45.16Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M233.75,220.4C209.76,208.75,196,183.82,196,152V134.72a12,12,0,0,0-7.56-11.15l-24.89-9.83a12,12,0,0,1-6.71-15.55l21.33-53a23.88,23.88,0,0,0-31.93-31A24.72,24.72,0,0,0,133.62,27.3l-21,53.1A12,12,0,0,1,97,87.13L71.63,76.84a12,12,0,0,0-13,2.73C38.3,100.45,28,124.82,28,152a107.5,107.5,0,0,0,30.07,74.77A4,4,0,0,0,61,228H232a4,4,0,0,0,1.75-7.6ZM64.34,85.15a3.94,3.94,0,0,1,4.3-.89L94,94.55a20,20,0,0,0,26-11.2l21-53C144.39,22.19,153.61,18,161.58,21a16,16,0,0,1,9.19,21.16L149.41,95.22a20,20,0,0,0,11.18,26l24.9,9.83a4,4,0,0,1,2.51,3.72V152c0,2.36.08,4.69.22,7l-138.5-55.4A110.84,110.84,0,0,1,64.34,85.15ZM113.56,220A91.35,91.35,0,0,1,86.9,175a4,4,0,0,0-7.75,2,100.21,100.21,0,0,0,23.09,43H62.68A99.5,99.5,0,0,1,36,152a89.37,89.37,0,0,1,9.73-41.4L189.13,168c3.22,22,13.23,40.09,28.8,52Z"}))]]),Mr=new Map([["bold",l.createElement(l.Fragment,null,l.createElement("path",{d:"M232.49,215.51,185,168a92.12,92.12,0,1,0-17,17l47.53,47.54a12,12,0,0,0,17-17ZM44,112a68,68,0,1,1,68,68A68.07,68.07,0,0,1,44,112Z"}))],["duotone",l.createElement(l.Fragment,null,l.createElement("path",{d:"M192,112a80,80,0,1,1-80-80A80,80,0,0,1,192,112Z",opacity:"0.2"}),l.createElement("path",{d:"M229.66,218.34,179.6,168.28a88.21,88.21,0,1,0-11.32,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["fill",l.createElement(l.Fragment,null,l.createElement("path",{d:"M168,112a56,56,0,1,1-56-56A56,56,0,0,1,168,112Zm61.66,117.66a8,8,0,0,1-11.32,0l-50.06-50.07a88,88,0,1,1,11.32-11.31l50.06,50.06A8,8,0,0,1,229.66,229.66ZM112,184a72,72,0,1,0-72-72A72.08,72.08,0,0,0,112,184Z"}))],["light",l.createElement(l.Fragment,null,l.createElement("path",{d:"M228.24,219.76l-51.38-51.38a86.15,86.15,0,1,0-8.48,8.48l51.38,51.38a6,6,0,0,0,8.48-8.48ZM38,112a74,74,0,1,1,74,74A74.09,74.09,0,0,1,38,112Z"}))],["regular",l.createElement(l.Fragment,null,l.createElement("path",{d:"M229.66,218.34l-50.07-50.06a88.11,88.11,0,1,0-11.31,11.31l50.06,50.07a8,8,0,0,0,11.32-11.32ZM40,112a72,72,0,1,1,72,72A72.08,72.08,0,0,1,40,112Z"}))],["thin",l.createElement(l.Fragment,null,l.createElement("path",{d:"M226.83,221.17l-52.7-52.7a84.1,84.1,0,1,0-5.66,5.66l52.7,52.7a4,4,0,0,0,5.66-5.66ZM36,112a76,76,0,1,1,76,76A76.08,76.08,0,0,1,36,112Z"}))]]),Dr=P.createContext({color:"currentColor",size:"1em",weight:"regular",mirrored:!1}),fe=l.forwardRef((n,a)=>{const{alt:g,color:f,size:p,weight:_,mirrored:S,children:x,weights:c,...E}=n,{color:u="currentColor",size:w,weight:T="regular",mirrored:k=!1,...M}=l.useContext(Dr);return l.createElement("svg",{ref:a,xmlns:"http://www.w3.org/2000/svg",width:p??w,height:p??w,fill:f??u,viewBox:"0 0 256 256",transform:S||k?"scale(-1, 1)":void 0,...M,...E},!!g&&l.createElement("title",null,g),x,c.get(_??T))});fe.displayName="IconBase";const qe=l.forwardRef((n,a)=>l.createElement(fe,{ref:a,...n,weights:Fr}));qe.displayName="BroomIcon";const ze=l.forwardRef((n,a)=>l.createElement(fe,{ref:a,...n,weights:Mr}));ze.displayName="MagnifyingGlassIcon";function ce(n,a){return a.split(".").reduce((g,f)=>g?g[f]:void 0,n)}function Nr({field:n,title:a,id:g,placeholder:f,value:p,options:_,icon:S,iconPosition:x="right",error:c,required:E,onChange:u,selected:w,isClearable:T,searchable:k=!1}){const[M,q]=P.useState(""),[z,L]=P.useState(!1),y=P.useRef(null),[J,ee]=P.useState("");P.useEffect(()=>{function j($){y.current&&!y.current.contains($.target)&&L(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[]);const U=j=>{u==null||u(j),L(!1)};return P.useEffect(()=>{ee(p)},[p]),b.jsxs("div",{className:"flex flex-col gap-2 w-full relative",ref:y,children:[a&&b.jsxs("label",{htmlFor:g,className:I.classnames("block text-md font-medium text-foreground",{"text-red-700":c}),children:[E&&b.jsx("span",{className:"text-red-500",children:"*"})," ",a?`${a}:`:""]}),b.jsxs("div",{className:I.classnames("cursor-pointer flex items-center justify-between bg-input border border-border text-foreground text-sm rounded-lg w-full p-2.5 pr-8",{"border-red-500":c}),onClick:()=>L(!z),children:[x==="left"&&S,b.jsx("span",{className:`flex-1 ${x==="left"&&"ml-3"}`,children:J||f||"Selecione..."}),x==="right"&&S]}),z&&b.jsxs("ul",{className:"absolute top-full left-0 w-[600px] max-h-72 overflow-y-auto border border-border rounded-lg bg-card z-10 shadow-lg mt-1",children:[b.jsx("li",{className:"p-3 cursor-pointer text-foreground",onClick:()=>T&&U({}),children:f||"Selecione..."},Ue()),k&&b.jsxs("li",{className:"px-2 cursor-pointer text-foreground flex gap-2 items-center justify-start",children:[b.jsx("div",{className:"flex-1",children:b.jsx(Be,{field:"",title:"",placeholder:"Buscar",icon:b.jsx(ze,{}),iconPosition:"left",onChange:j=>q(j.target.value),value:M})}),b.jsx(He,{color:"blue",title:"",icon:b.jsx(qe,{}),positionIcon:"left",onClick:()=>{U({}),q("")},className:"m-0"})]}),_.filter(j=>{const $=ce(j,n);return String($).toLowerCase().includes(M.toLowerCase())}).map(j=>b.jsx("li",{className:I.classnames("p-2 hover:bg-primary cursor-pointer text-foreground",{"bg-primary":ce(j,n)===p||(w==null?void 0:w[n])===j[n]}),onClick:()=>U(j),children:ce(j,n)},Ue()))]}),c&&b.jsx("p",{className:"text-sm text-red-600 mt-1",children:c})]})}exports.Button=He;exports.Input=Be;exports.ProcessHubProvider=Tr;exports.Select=Nr;exports.useTheme=Ye;
|