@processhub-lib/react 1.0.0
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 +6 -0
- package/dist/context/ThemeContext.d.ts +22 -0
- package/dist/index-B6iFW4Kz.js +1171 -0
- package/dist/index-fvSAulfO.cjs +30 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +10 -0
- package/dist/style.css +1 -0
- package/dist/ui/Button/colors.d.ts +162 -0
- package/dist/ui/Button/index.d.ts +3 -0
- package/dist/ui/Button/types/button.d.ts +16 -0
- package/dist/ui/Input/index.d.ts +3 -0
- package/dist/ui/Input/types/input.d.ts +10 -0
- package/dist/ui/Select/index.d.ts +3 -0
- package/dist/ui/Select/types/select.d.ts +16 -0
- package/dist/ui/index.d.ts +3 -0
- package/dist/ui.cjs.js +1 -0
- package/dist/ui.d.ts +1 -0
- package/dist/ui.es.js +6 -0
- package/dist/utils/classnames.d.ts +16 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils.cjs.js +1 -0
- package/dist/utils.d.ts +1 -0
- package/dist/utils.es.js +29 -0
- package/package.json +56 -0
- package/postcss.config.js +5 -0
- package/src/context/ThemeContext.tsx +45 -0
- package/src/index.ts +4 -0
- package/src/style.css +1 -0
- package/src/ui/Button/colors.tsx +163 -0
- package/src/ui/Button/index.tsx +46 -0
- package/src/ui/Button/types/button.ts +17 -0
- package/src/ui/Input/index.tsx +74 -0
- package/src/ui/Input/types/input.ts +11 -0
- package/src/ui/Select/index.tsx +149 -0
- package/src/ui/Select/types/select.ts +16 -0
- package/src/ui/index.ts +3 -0
- package/src/utils/classnames.tsx +89 -0
- package/src/utils/index.ts +1 -0
- package/tailwind.config.js +13 -0
- package/tsconfig.json +26 -0
- package/tsconfig.node.json +10 -0
- package/vite.config.ts +31 -0
|
@@ -0,0 +1,30 @@
|
|
|
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(i){return String(i)});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,i=d._init;try{return F(i(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 i=function(){throw Error()};if(Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(A){o=A}Reflect.construct(e,[],i)}else{try{i.call()}catch(A){o=A}e.call(i.prototype)}}else{try{throw Error()}catch(A){o=A}e()}}catch(A){if(A&&o&&typeof A.stack=="string"){for(var s=A.stack.split(`
|
|
19
|
+
`),C=o.stack.split(`
|
|
20
|
+
`),h=s.length-1,m=C.length-1;h>=1&&m>=0&&s[h]!==C[m];)m--;for(;h>=1&&m>=0;h--,m--)if(s[h]!==C[m]){if(h!==1||m!==1)do if(h--,m--,m<0||s[h]!==C[m]){var O=`
|
|
21
|
+
`+s[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 i in e)if(v(e,i)){var s=void 0;try{if(typeof e[i]!="function"){var C=Error((o||"React class")+": "+t+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw C.name="Invariant Violation",C}s=e[i](r,i,o,t,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(h){s=h}s&&!(s 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,i,typeof s),Q(null)),s instanceof Error&&!(s.message in _e)&&(_e[s.message]=!0,Q(d),y("Failed %s type: %s",t,s.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,sr={key:!0,ref:!0,__self:!0,__source:!0},Ae,Oe;function ir(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,i){var s={$$typeof:a,type:e,key:r,ref:t,props:i,_owner:v};return s._store={},Object.defineProperty(s._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(s,"_self",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.defineProperty(s,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(s.props),Object.freeze(s)),s};function gr(e,r,t,o,d){{var v,i={},s=null,C=null;t!==void 0&&(Se(t),s=""+t),ur(r)&&(Se(r.key),s=""+r.key),ir(r)&&(C=r.ref,cr(r,d));for(v in r)Y.call(r,v)&&!sr.hasOwnProperty(v)&&(i[v]=r[v]);if(e&&e.defaultProps){var h=e.defaultProps;for(v in h)i[v]===void 0&&(i[v]=h[v])}if(s||C){var m=typeof e=="function"?e.displayName||e.name||"Unknown":e;s&&dr(i,m),C&&fr(i,m)}return vr(e,s,C,d,o,Te.current,i)}}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 se(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];se(o)&&Fe(o,r)}else if(se(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),i;!(i=v.next()).done;)se(i.value)&&Fe(i.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 i=Ke(e);if(!i){var s="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(s+=" 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?s+=C:s+=ke();var h;e===null?h="null":ae(e)?h="array":e!==void 0&&e.$$typeof===a?(h="<"+(F(e.type)||"Unknown")+" />",s=" 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,s)}var m=gr(e,r,t,d,v);if(m==null)return m;if(i){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"}),ie=A.length>0?"{key: someKey, "+A.join(": ..., ")+": ...}":"{key: someKey}";if(!De[N+ie]){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} />`,ie,N,Rr,N),De[N+ie]=!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,"testedsad",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;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-fvSAulfO.cjs"),s=require("./utils.cjs.js");exports.Button=e.Button;exports.Input=e.Input;exports.ProcessHubProvider=e.ProcessHubProvider;exports.Select=e.Select;exports.useTheme=e.useTheme;exports.classnames=s.classnames;
|
package/dist/index.d.ts
ADDED
package/dist/index.es.js
ADDED
package/dist/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-duration:initial}}}@layer theme{:root,:host{--font-sans:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";--font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--color-red-500:oklch(63.7% .237 25.331);--color-red-600:oklch(57.7% .245 27.325);--color-red-700:oklch(50.5% .213 27.518);--color-yellow-500:oklch(79.5% .184 86.047);--color-yellow-600:oklch(68.1% .162 75.834);--color-green-500:oklch(72.3% .219 149.579);--color-green-600:oklch(62.7% .194 149.214);--color-blue-500:oklch(62.3% .214 259.815);--color-blue-600:oklch(54.6% .245 262.881);--color-gray-400:oklch(70.7% .022 261.325);--color-black:#000;--color-white:#fff;--spacing:.25rem;--text-sm:.875rem;--text-sm--line-height:calc(1.25/.875);--font-weight-medium:500;--font-weight-bold:700;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4,0,.2,1);--default-font-family:var(--font-sans);--default-mono-font-family:var(--font-mono)}}@layer base{*,:after,:before,::backdrop{box-sizing:border-box;border:0 solid;margin:0;padding:0}::file-selector-button{box-sizing:border-box;border:0 solid;margin:0;padding:0}html,:host{-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;line-height:1.5;font-family:var(--default-font-family,ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings,normal);font-variation-settings:var(--default-font-variation-settings,normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace);font-feature-settings:var(--default-mono-font-feature-settings,normal);font-variation-settings:var(--default-mono-font-variation-settings,normal);font-size:1em}small{font-size:80%}sub,sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{vertical-align:middle;display:block}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;opacity:1;background-color:#0000;border-radius:0}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not ((-webkit-appearance:-apple-pay-button))) or (contain-intrinsic-size:1px){::placeholder{color:currentColor}@supports (color:color-mix(in lab,red,red)){::placeholder{color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit{padding-block:0}::-webkit-datetime-edit-year-field{padding-block:0}::-webkit-datetime-edit-month-field{padding-block:0}::-webkit-datetime-edit-day-field{padding-block:0}::-webkit-datetime-edit-hour-field{padding-block:0}::-webkit-datetime-edit-minute-field{padding-block:0}::-webkit-datetime-edit-second-field{padding-block:0}::-webkit-datetime-edit-millisecond-field{padding-block:0}::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]){-webkit-appearance:button;-moz-appearance:button;appearance:button}::file-selector-button{-webkit-appearance:button;-moz-appearance:button;appearance:button}::-webkit-inner-spin-button{height:auto}::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer components;@layer utilities{.absolute{position:absolute}.relative{position:relative}.static{position:static}.top-full{top:100%}.left-0{left:calc(var(--spacing)*0)}.z-10{z-index:10}.m-0{margin:calc(var(--spacing)*0)}.mt-1{margin-top:calc(var(--spacing)*1)}.mt-2{margin-top:calc(var(--spacing)*2)}.ml-3{margin-left:calc(var(--spacing)*3)}.block{display:block}.flex{display:flex}.max-h-72{max-height:calc(var(--spacing)*72)}.w-\[600px\]{width:600px}.w-auto{width:auto}.w-full{width:100%}.flex-1{flex:1}.transform{transform:var(--tw-rotate-x,)var(--tw-rotate-y,)var(--tw-rotate-z,)var(--tw-skew-x,)var(--tw-skew-y,)}.cursor-not-allowed{cursor:not-allowed}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.gap-2{gap:calc(var(--spacing)*2)}.overflow-y-auto{overflow-y:auto}.rounded-lg{border-radius:var(--radius-lg)}.border{border-style:var(--tw-border-style);border-width:1px}.border-none{--tw-border-style:none;border-style:none}.border-blue-500{border-color:var(--color-blue-500)}.border-green-500{border-color:var(--color-green-500)}.border-red-500{border-color:var(--color-red-500)}.border-transparent{border-color:#0000}.border-yellow-500{border-color:var(--color-yellow-500)}.bg-blue-500{background-color:var(--color-blue-500)}.bg-gray-400\/40{background-color:#99a1af66}@supports (color:color-mix(in lab,red,red)){.bg-gray-400\/40{background-color:color-mix(in oklab,var(--color-gray-400)40%,transparent)}}.bg-green-500{background-color:var(--color-green-500)}.bg-red-500{background-color:var(--color-red-500)}.bg-transparent{background-color:#0000}.bg-yellow-500{background-color:var(--color-yellow-500)}.p-2{padding:calc(var(--spacing)*2)}.p-2\.5{padding:calc(var(--spacing)*2.5)}.p-3{padding:calc(var(--spacing)*3)}.px-2{padding-inline:calc(var(--spacing)*2)}.px-4{padding-inline:calc(var(--spacing)*4)}.py-2{padding-block:calc(var(--spacing)*2)}.pr-8{padding-right:calc(var(--spacing)*8)}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.text-black{color:var(--color-black)}.text-blue-600{color:var(--color-blue-600)}.text-green-600{color:var(--color-green-600)}.text-red-500{color:var(--color-red-500)}.text-red-600{color:var(--color-red-600)}.text-red-700{color:var(--color-red-700)}.text-white{color:var(--color-white)}.text-yellow-600{color:var(--color-yellow-600)}.placeholder-red-500::placeholder{color:var(--color-red-500)}.opacity-50{opacity:.5}.shadow-lg{--tw-shadow:0 10px 15px -3px var(--tw-shadow-color,#0000001a),0 4px 6px -4px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a),0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.first-letter\:uppercase:first-letter{text-transform:uppercase}@media (hover:hover){.hover\:bg-blue-500:hover{background-color:var(--color-blue-500)}.hover\:bg-blue-600:hover{background-color:var(--color-blue-600)}.hover\:bg-green-600:hover{background-color:var(--color-green-600)}.hover\:bg-red-500:hover{background-color:var(--color-red-500)}.hover\:bg-red-600:hover{background-color:var(--color-red-600)}.hover\:bg-yellow-500:hover{background-color:var(--color-yellow-500)}.hover\:bg-yellow-600:hover{background-color:var(--color-yellow-600)}.hover\:text-black:hover{color:var(--color-black)}.hover\:text-white:hover{color:var(--color-white)}}.focus\:border-red-500:focus{border-color:var(--color-red-500)}.focus\:ring-red-500:focus{--tw-ring-color:var(--color-red-500)}.focus\:outline-none:focus{--tw-outline-style:none;outline-style:none}@media (prefers-color-scheme:dark){.dark\:text-red-500{color:var(--color-red-500)}}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-duration{syntax:"*";inherits:false}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
export declare const COLORS: {
|
|
2
|
+
green: {
|
|
3
|
+
solid: {
|
|
4
|
+
bg: string;
|
|
5
|
+
hover: string;
|
|
6
|
+
text: string;
|
|
7
|
+
border: string;
|
|
8
|
+
};
|
|
9
|
+
outline: {
|
|
10
|
+
bg: string;
|
|
11
|
+
hover: string;
|
|
12
|
+
text: string;
|
|
13
|
+
border: string;
|
|
14
|
+
};
|
|
15
|
+
ghost: {
|
|
16
|
+
bg: string;
|
|
17
|
+
hover: string;
|
|
18
|
+
text: string;
|
|
19
|
+
border: string;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
blue: {
|
|
23
|
+
solid: {
|
|
24
|
+
bg: string;
|
|
25
|
+
hover: string;
|
|
26
|
+
text: string;
|
|
27
|
+
border: string;
|
|
28
|
+
};
|
|
29
|
+
outline: {
|
|
30
|
+
bg: string;
|
|
31
|
+
hover: string;
|
|
32
|
+
text: string;
|
|
33
|
+
border: string;
|
|
34
|
+
};
|
|
35
|
+
ghost: {
|
|
36
|
+
bg: string;
|
|
37
|
+
hover: string;
|
|
38
|
+
text: string;
|
|
39
|
+
border: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
red: {
|
|
43
|
+
solid: {
|
|
44
|
+
bg: string;
|
|
45
|
+
hover: string;
|
|
46
|
+
text: string;
|
|
47
|
+
border: string;
|
|
48
|
+
};
|
|
49
|
+
outline: {
|
|
50
|
+
bg: string;
|
|
51
|
+
hover: string;
|
|
52
|
+
text: string;
|
|
53
|
+
border: string;
|
|
54
|
+
};
|
|
55
|
+
ghost: {
|
|
56
|
+
bg: string;
|
|
57
|
+
hover: string;
|
|
58
|
+
text: string;
|
|
59
|
+
border: string;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
yellow: {
|
|
63
|
+
solid: {
|
|
64
|
+
bg: string;
|
|
65
|
+
hover: string;
|
|
66
|
+
text: string;
|
|
67
|
+
border: string;
|
|
68
|
+
};
|
|
69
|
+
outline: {
|
|
70
|
+
bg: string;
|
|
71
|
+
hover: string;
|
|
72
|
+
text: string;
|
|
73
|
+
border: string;
|
|
74
|
+
};
|
|
75
|
+
ghost: {
|
|
76
|
+
bg: string;
|
|
77
|
+
hover: string;
|
|
78
|
+
text: string;
|
|
79
|
+
border: string;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
primary: {
|
|
83
|
+
solid: {
|
|
84
|
+
bg: string;
|
|
85
|
+
hover: string;
|
|
86
|
+
text: string;
|
|
87
|
+
border: string;
|
|
88
|
+
};
|
|
89
|
+
outline: {
|
|
90
|
+
bg: string;
|
|
91
|
+
hover: string;
|
|
92
|
+
text: string;
|
|
93
|
+
border: string;
|
|
94
|
+
};
|
|
95
|
+
ghost: {
|
|
96
|
+
bg: string;
|
|
97
|
+
hover: string;
|
|
98
|
+
text: string;
|
|
99
|
+
border: string;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
secondary: {
|
|
103
|
+
solid: {
|
|
104
|
+
bg: string;
|
|
105
|
+
hover: string;
|
|
106
|
+
text: string;
|
|
107
|
+
border: string;
|
|
108
|
+
};
|
|
109
|
+
outline: {
|
|
110
|
+
bg: string;
|
|
111
|
+
hover: string;
|
|
112
|
+
text: string;
|
|
113
|
+
border: string;
|
|
114
|
+
};
|
|
115
|
+
ghost: {
|
|
116
|
+
bg: string;
|
|
117
|
+
hover: string;
|
|
118
|
+
text: string;
|
|
119
|
+
border: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
destructive: {
|
|
123
|
+
solid: {
|
|
124
|
+
bg: string;
|
|
125
|
+
hover: string;
|
|
126
|
+
text: string;
|
|
127
|
+
border: string;
|
|
128
|
+
};
|
|
129
|
+
outline: {
|
|
130
|
+
bg: string;
|
|
131
|
+
hover: string;
|
|
132
|
+
text: string;
|
|
133
|
+
border: string;
|
|
134
|
+
};
|
|
135
|
+
ghost: {
|
|
136
|
+
bg: string;
|
|
137
|
+
hover: string;
|
|
138
|
+
text: string;
|
|
139
|
+
border: string;
|
|
140
|
+
};
|
|
141
|
+
};
|
|
142
|
+
card: {
|
|
143
|
+
solid: {
|
|
144
|
+
bg: string;
|
|
145
|
+
hover: string;
|
|
146
|
+
text: string;
|
|
147
|
+
border: string;
|
|
148
|
+
};
|
|
149
|
+
outline: {
|
|
150
|
+
bg: string;
|
|
151
|
+
hover: string;
|
|
152
|
+
text: string;
|
|
153
|
+
border: string;
|
|
154
|
+
};
|
|
155
|
+
ghost: {
|
|
156
|
+
bg: string;
|
|
157
|
+
hover: string;
|
|
158
|
+
text: string;
|
|
159
|
+
border: string;
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { COLORS } from '../colors';
|
|
2
|
+
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
onClick?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
|
|
5
|
+
title: string;
|
|
6
|
+
icon?: JSX.Element;
|
|
7
|
+
positionIcon?: "left" | "right";
|
|
8
|
+
disable?: boolean;
|
|
9
|
+
className?: string;
|
|
10
|
+
type?: "button" | "submit" | "reset";
|
|
11
|
+
color: Color;
|
|
12
|
+
variant?: "solid" | "outline" | "ghost";
|
|
13
|
+
}
|
|
14
|
+
export interface CustomColors {
|
|
15
|
+
}
|
|
16
|
+
export type Color = keyof typeof COLORS | keyof CustomColors | (string & {});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type inputElementsType<T> = {
|
|
2
|
+
mask?: string;
|
|
3
|
+
field: keyof T;
|
|
4
|
+
title: string;
|
|
5
|
+
iconPosition?: "left" | "right";
|
|
6
|
+
icon?: React.JSX.Element;
|
|
7
|
+
} & React.InputHTMLAttributes<HTMLInputElement | HTMLSelectElement>;
|
|
8
|
+
export type InputProps<T> = {
|
|
9
|
+
error?: string;
|
|
10
|
+
} & inputElementsType<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export type SelectProps<T> = {
|
|
2
|
+
title: string;
|
|
3
|
+
id: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
field: keyof T & string;
|
|
6
|
+
value: string;
|
|
7
|
+
options: T[];
|
|
8
|
+
icon?: React.ReactNode;
|
|
9
|
+
iconPosition?: "left" | "right";
|
|
10
|
+
error?: string;
|
|
11
|
+
required?: boolean;
|
|
12
|
+
onChange?: (value: T) => void;
|
|
13
|
+
selected?: T;
|
|
14
|
+
isClearable?: boolean;
|
|
15
|
+
searchable?: boolean;
|
|
16
|
+
};
|
package/dist/ui.cjs.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./index-fvSAulfO.cjs");exports.Button=t.Button;exports.Input=t.Input;exports.Select=t.Select;
|
package/dist/ui.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './ui/index'
|
package/dist/ui.es.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constrói uma string de classes CSS dinamicamente.
|
|
3
|
+
*
|
|
4
|
+
* Aceita qualquer número de argumentos do tipo string, boolean, null, undefined ou objeto:
|
|
5
|
+
* - Strings são adicionadas diretamente.
|
|
6
|
+
* - Objetos: chaves com valor truthy são incluídas como classes.
|
|
7
|
+
* - Arrays são processados recursivamente.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* classnames("btn", { active: isActive, disabled: false }, ["px-2", null])
|
|
11
|
+
* // Resultado: "btn active px-2"
|
|
12
|
+
*
|
|
13
|
+
* @param {...(string | object | undefined | null | boolean)[]} args - Lista de classes e condições.
|
|
14
|
+
* @returns {string} String final de classes separadas por espaço.
|
|
15
|
+
*/
|
|
16
|
+
export declare function classnames(...args: (string | object | undefined | null | boolean)[]): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './classnames';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s={}.hasOwnProperty;function i(...t){let n="";for(let e=0;e<t.length;e++){const r=t[e];r&&(n=o(n,c(r)))}return n}function c(t){if(typeof t=="string")return t;if(typeof t!="object"||t===null)return"";if(Array.isArray(t))return i(...t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();let n="";for(const e in t)s.call(t,e)&&t[e]&&(n=o(n,e));return n}function o(t,n){return n?t?`${t} ${n}`:n:t}exports.classnames=i;
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './utils/index'
|
package/dist/utils.es.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
const o = {}.hasOwnProperty;
|
|
2
|
+
function s(...t) {
|
|
3
|
+
let n = "";
|
|
4
|
+
for (let e = 0; e < t.length; e++) {
|
|
5
|
+
const r = t[e];
|
|
6
|
+
r && (n = i(n, c(r)));
|
|
7
|
+
}
|
|
8
|
+
return n;
|
|
9
|
+
}
|
|
10
|
+
function c(t) {
|
|
11
|
+
if (typeof t == "string")
|
|
12
|
+
return t;
|
|
13
|
+
if (typeof t != "object" || t === null)
|
|
14
|
+
return "";
|
|
15
|
+
if (Array.isArray(t))
|
|
16
|
+
return s(...t);
|
|
17
|
+
if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
|
|
18
|
+
return t.toString();
|
|
19
|
+
let n = "";
|
|
20
|
+
for (const e in t)
|
|
21
|
+
o.call(t, e) && t[e] && (n = i(n, e));
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
function i(t, n) {
|
|
25
|
+
return n ? t ? `${t} ${n}` : n : t;
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
s as classnames
|
|
29
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@processhub-lib/react",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "vite build"
|
|
7
|
+
},
|
|
8
|
+
"main": "./dist/index.cjs.js",
|
|
9
|
+
"module": "./dist/index.es.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"import": "./dist/index.es.js",
|
|
14
|
+
"require": "./dist/index.cjs.js",
|
|
15
|
+
"types": "./dist/index.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./ui": {
|
|
18
|
+
"import": "./dist/ui.es.js",
|
|
19
|
+
"require": "./dist/ui.cjs.js",
|
|
20
|
+
"types": "./dist/ui/index.d.ts"
|
|
21
|
+
},
|
|
22
|
+
"./utils": {
|
|
23
|
+
"import": "./dist/utils.es.js",
|
|
24
|
+
"require": "./dist/utils.cjs.js",
|
|
25
|
+
"types": "./dist/utils/index.d.ts"
|
|
26
|
+
},
|
|
27
|
+
"./style.css": "./dist/style.css"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"react": "^18.3.1",
|
|
31
|
+
"react-dom": "^18.3.1",
|
|
32
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
33
|
+
"uuid": "^13.0.0"
|
|
34
|
+
},
|
|
35
|
+
"devDependencies": {
|
|
36
|
+
"@types/node": "^22.5.5",
|
|
37
|
+
"@types/react": "^18.3.8",
|
|
38
|
+
"@types/react-dom": "^18.3.0",
|
|
39
|
+
"react": "^18.3.1",
|
|
40
|
+
"react-dom": "^18.3.1",
|
|
41
|
+
"typescript": "^5.5.3",
|
|
42
|
+
"typescript-eslint": "^8.0.1",
|
|
43
|
+
"vite": "^5.4.19",
|
|
44
|
+
"vite-plugin-dts": "^3.0.0"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
48
|
+
"@tailwindcss/postcss": "^4.1.18",
|
|
49
|
+
"@tailwindcss/vite": "^4.1.18",
|
|
50
|
+
"autoprefixer": "^10.4.23",
|
|
51
|
+
"caniuse-lite": "^1.0.30001761",
|
|
52
|
+
"postcss": "^8.5.6",
|
|
53
|
+
"tailwindcss": "^4.1.18",
|
|
54
|
+
"uuid": "^13.0.0"
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { createContext, useContext, ReactNode } from "react";
|
|
2
|
+
import { COLORS } from "../ui/Button/colors";
|
|
3
|
+
|
|
4
|
+
export interface ColorSet {
|
|
5
|
+
bg: string;
|
|
6
|
+
hover: string;
|
|
7
|
+
text: string;
|
|
8
|
+
border: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface Theme {
|
|
12
|
+
[key: string]: {
|
|
13
|
+
solid: ColorSet;
|
|
14
|
+
outline: ColorSet;
|
|
15
|
+
ghost: ColorSet;
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const ThemeContext = createContext<Theme>(COLORS as Theme);
|
|
20
|
+
|
|
21
|
+
export const useTheme = () => {
|
|
22
|
+
const context = useContext(ThemeContext);
|
|
23
|
+
if (!context) {
|
|
24
|
+
throw new Error("useTheme must be used within a ProcessHubProvider");
|
|
25
|
+
}
|
|
26
|
+
return context;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
interface ProcessHubProviderProps {
|
|
30
|
+
children: ReactNode;
|
|
31
|
+
theme?: Partial<Theme>;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const ProcessHubProvider: React.FC<ProcessHubProviderProps> = ({
|
|
35
|
+
children,
|
|
36
|
+
theme = {},
|
|
37
|
+
}) => {
|
|
38
|
+
const activeTheme = { ...COLORS, ...theme } as Theme;
|
|
39
|
+
|
|
40
|
+
return (
|
|
41
|
+
<ThemeContext.Provider value={activeTheme}>
|
|
42
|
+
{children}
|
|
43
|
+
</ThemeContext.Provider>
|
|
44
|
+
);
|
|
45
|
+
};
|
package/src/index.ts
ADDED
package/src/style.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "tailwindcss";
|