@emporix/component-library 1.2.0 → 1.3.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/dist/components/dropdown/Dropdown.d.ts +70 -0
- package/dist/components/dropdown/Dropdown.d.ts.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.es.js +625 -434
- package/dist/index.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +4 -4
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(B,b){typeof exports=="object"&&typeof module<"u"?b(exports,require("react")):typeof define=="function"&&define.amd?define(["exports","react"],b):(B=typeof globalThis<"u"?globalThis:B||self,b(B.EmporixComponentLibrary={},B.React))})(this,(function(B,b){"use strict";var re={exports:{}},K={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Te;function er(){if(Te)return K;Te=1;var t=b,a=Symbol.for("react.element"),i=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,p=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,O={key:!0,ref:!0,__self:!0,__source:!0};function C(y,f,T){var w,k={},F=null,R=null;T!==void 0&&(F=""+T),f.key!==void 0&&(F=""+f.key),f.ref!==void 0&&(R=f.ref);for(w in f)o.call(f,w)&&!O.hasOwnProperty(w)&&(k[w]=f[w]);if(y&&y.defaultProps)for(w in f=y.defaultProps,f)k[w]===void 0&&(k[w]=f[w]);return{$$typeof:a,type:y,key:F,ref:R,props:k,_owner:p.current}}return K.Fragment=i,K.jsx=C,K.jsxs=C,K}var J={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var
|
|
18
|
-
`+
|
|
19
|
-
`),
|
|
20
|
-
`),
|
|
21
|
-
`+
|
|
17
|
+
*/var De;function rr(){return De||(De=1,process.env.NODE_ENV!=="production"&&(function(){var t=b,a=Symbol.for("react.element"),i=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),C=Symbol.for("react.provider"),y=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),P=Symbol.iterator,Y="@@iterator";function ie(e){if(e===null||typeof e!="object")return null;var r=P&&e[P]||e[Y];return typeof r=="function"?r:null}var A=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function h(e){{for(var r=arguments.length,n=new Array(r>1?r-1:0),l=1;l<r;l++)n[l-1]=arguments[l];M("error",e,n)}}function M(e,r,n){{var l=A.ReactDebugCurrentFrame,d=l.getStackAddendum();d!==""&&(r+="%s",n=n.concat([d]));var v=n.map(function(u){return String(u)});v.unshift("Warning: "+r),Function.prototype.apply.call(console[e],console,v)}}var G=!1,je=!1,oe=!1,se=!1,le=!1,ce;ce=Symbol.for("react.module.reference");function Le(e){return!!(typeof e=="string"||typeof e=="function"||e===o||e===O||le||e===p||e===T||e===w||se||e===R||G||je||oe||typeof e=="object"&&e!==null&&(e.$$typeof===F||e.$$typeof===k||e.$$typeof===C||e.$$typeof===y||e.$$typeof===f||e.$$typeof===ce||e.getModuleId!==void 0))}function L(e,r,n){var l=e.displayName;if(l)return l;var d=r.displayName||r.name||"";return d!==""?n+"("+d+")":n}function ue(e){return e.displayName||"Context"}function N(e){if(e==null)return null;if(typeof e.tag=="number"&&h("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 o:return"Fragment";case i:return"Portal";case O:return"Profiler";case p:return"StrictMode";case T:return"Suspense";case w:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case y:var r=e;return ue(r)+".Consumer";case C:var n=e;return ue(n._context)+".Provider";case f:return L(e,e.render,"ForwardRef");case k:var l=e.displayName||null;return l!==null?l:N(e.type)||"Memo";case F:{var d=e,v=d._payload,u=d._init;try{return N(u(v))}catch{return null}}}return null}var $=Object.assign,V=0,fe,de,U,X,s,g,W;function ve(){}ve.__reactDisabledLog=!0;function Oe(){{if(V===0){fe=console.log,de=console.info,U=console.warn,X=console.error,s=console.group,g=console.groupCollapsed,W=console.groupEnd;var e={configurable:!0,enumerable:!0,value:ve,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}V++}}function pe(){{if(V--,V===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:$({},e,{value:fe}),info:$({},e,{value:de}),warn:$({},e,{value:U}),error:$({},e,{value:X}),group:$({},e,{value:s}),groupCollapsed:$({},e,{value:g}),groupEnd:$({},e,{value:W})})}V<0&&h("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Z=A.ReactCurrentDispatcher,Q;function be(e,r,n){{if(Q===void 0)try{throw Error()}catch(d){var l=d.stack.trim().match(/\n( *(at )?)/);Q=l&&l[1]||""}return`
|
|
18
|
+
`+Q+e}}var Ce=!1,_e;{var yr=typeof WeakMap=="function"?WeakMap:Map;_e=new yr}function $e(e,r){if(!e||Ce)return"";{var n=_e.get(e);if(n!==void 0)return n}var l;Ce=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var v;v=Z.current,Z.current=null,Oe();try{if(r){var u=function(){throw Error()};if(Object.defineProperty(u.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(u,[])}catch(S){l=S}Reflect.construct(e,[],u)}else{try{u.call()}catch(S){l=S}e.call(u.prototype)}}else{try{throw Error()}catch(S){l=S}e()}}catch(S){if(S&&l&&typeof S.stack=="string"){for(var c=S.stack.split(`
|
|
19
|
+
`),x=l.stack.split(`
|
|
20
|
+
`),m=c.length-1,E=x.length-1;m>=1&&E>=0&&c[m]!==x[E];)E--;for(;m>=1&&E>=0;m--,E--)if(c[m]!==x[E]){if(m!==1||E!==1)do if(m--,E--,E<0||c[m]!==x[E]){var D=`
|
|
21
|
+
`+c[m].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&_e.set(e,D),D}while(m>=1&&E>=0);break}}}finally{Ce=!1,Z.current=v,pe(),Error.prepareStackTrace=d}var q=e?e.displayName||e.name:"",z=q?be(q):"";return typeof e=="function"&&_e.set(e,z),z}function mr(e,r,n){return $e(e,!1)}function hr(e){var r=e.prototype;return!!(r&&r.isReactComponent)}function ye(e,r,n){if(e==null)return"";if(typeof e=="function")return $e(e,hr(e));if(typeof e=="string")return be(e);switch(e){case T:return be("Suspense");case w:return be("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case f:return mr(e.render);case k:return ye(e.type,r,n);case F:{var l=e,d=l._payload,v=l._init;try{return ye(v(d),r,n)}catch{}}}return""}var ee=Object.prototype.hasOwnProperty,We={},Ye=A.ReactDebugCurrentFrame;function me(e){if(e){var r=e._owner,n=ye(e.type,e._source,r?r.type:null);Ye.setExtraStackFrame(n)}else Ye.setExtraStackFrame(null)}function gr(e,r,n,l,d){{var v=Function.call.bind(ee);for(var u in e)if(v(e,u)){var c=void 0;try{if(typeof e[u]!="function"){var x=Error((l||"React class")+": "+n+" type `"+u+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[u]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw x.name="Invariant Violation",x}c=e[u](r,u,l,n,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(m){c=m}c&&!(c instanceof Error)&&(me(d),h("%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).",l||"React class",n,u,typeof c),me(null)),c instanceof Error&&!(c.message in We)&&(We[c.message]=!0,me(d),h("Failed %s type: %s",n,c.message),me(null))}}}var Er=Array.isArray;function we(e){return Er(e)}function jr(e){{var r=typeof Symbol=="function"&&Symbol.toStringTag,n=r&&e[Symbol.toStringTag]||e.constructor.name||"Object";return n}}function Or(e){try{return Me(e),!1}catch{return!0}}function Me(e){return""+e}function Ve(e){if(Or(e))return h("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",jr(e)),Me(e)}var ze=A.ReactCurrentOwner,Cr={key:!0,ref:!0,__self:!0,__source:!0},Ue,He;function wr(e){if(ee.call(e,"ref")){var r=Object.getOwnPropertyDescriptor(e,"ref").get;if(r&&r.isReactWarning)return!1}return e.ref!==void 0}function xr(e){if(ee.call(e,"key")){var r=Object.getOwnPropertyDescriptor(e,"key").get;if(r&&r.isReactWarning)return!1}return e.key!==void 0}function Rr(e,r){typeof e.ref=="string"&&ze.current}function Pr(e,r){{var n=function(){Ue||(Ue=!0,h("%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))};n.isReactWarning=!0,Object.defineProperty(e,"key",{get:n,configurable:!0})}}function Sr(e,r){{var n=function(){He||(He=!0,h("%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))};n.isReactWarning=!0,Object.defineProperty(e,"ref",{get:n,configurable:!0})}}var Tr=function(e,r,n,l,d,v,u){var c={$$typeof:a,type:e,key:r,ref:n,props:u,_owner:v};return c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(c,"_self",{configurable:!1,enumerable:!1,writable:!1,value:l}),Object.defineProperty(c,"_source",{configurable:!1,enumerable:!1,writable:!1,value:d}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c};function Dr(e,r,n,l,d){{var v,u={},c=null,x=null;n!==void 0&&(Ve(n),c=""+n),xr(r)&&(Ve(r.key),c=""+r.key),wr(r)&&(x=r.ref,Rr(r,d));for(v in r)ee.call(r,v)&&!Cr.hasOwnProperty(v)&&(u[v]=r[v]);if(e&&e.defaultProps){var m=e.defaultProps;for(v in m)u[v]===void 0&&(u[v]=m[v])}if(c||x){var E=typeof e=="function"?e.displayName||e.name||"Unknown":e;c&&Pr(u,E),x&&Sr(u,E)}return Tr(e,c,x,d,l,ze.current,u)}}var xe=A.ReactCurrentOwner,qe=A.ReactDebugCurrentFrame;function H(e){if(e){var r=e._owner,n=ye(e.type,e._source,r?r.type:null);qe.setExtraStackFrame(n)}else qe.setExtraStackFrame(null)}var Re;Re=!1;function Pe(e){return typeof e=="object"&&e!==null&&e.$$typeof===a}function Ke(){{if(xe.current){var e=N(xe.current.type);if(e)return`
|
|
22
22
|
|
|
23
|
-
Check the render method of \``+e+"`."}return""}}function
|
|
23
|
+
Check the render method of \``+e+"`."}return""}}function kr(e){return""}var Je={};function Nr(e){{var r=Ke();if(!r){var n=typeof e=="string"?e:e.displayName||e.name;n&&(r=`
|
|
24
24
|
|
|
25
|
-
Check the top-level render call using <`+
|
|
25
|
+
Check the top-level render call using <`+n+">.")}return r}}function Ge(e,r){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var n=Nr(r);if(Je[n])return;Je[n]=!0;var l="";e&&e._owner&&e._owner!==xe.current&&(l=" It was passed a child from "+N(e._owner.type)+"."),H(e),h('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',n,l),H(null)}}function Xe(e,r){{if(typeof e!="object")return;if(we(e))for(var n=0;n<e.length;n++){var l=e[n];Pe(l)&&Ge(l,r)}else if(Pe(e))e._store&&(e._store.validated=!0);else if(e){var d=ie(e);if(typeof d=="function"&&d!==e.entries)for(var v=d.call(e),u;!(u=v.next()).done;)Pe(u.value)&&Ge(u.value,r)}}}function Br(e){{var r=e.type;if(r==null||typeof r=="string")return;var n;if(typeof r=="function")n=r.propTypes;else if(typeof r=="object"&&(r.$$typeof===f||r.$$typeof===k))n=r.propTypes;else return;if(n){var l=N(r);gr(n,e.props,"prop",l,e)}else if(r.PropTypes!==void 0&&!Re){Re=!0;var d=N(r);h("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",d||"Unknown")}typeof r.getDefaultProps=="function"&&!r.getDefaultProps.isReactClassApproved&&h("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Ir(e){{for(var r=Object.keys(e.props),n=0;n<r.length;n++){var l=r[n];if(l!=="children"&&l!=="key"){H(e),h("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",l),H(null);break}}e.ref!==null&&(H(e),h("Invalid attribute `ref` supplied to `React.Fragment`."),H(null))}}var Ze={};function Qe(e,r,n,l,d,v){{var u=Le(e);if(!u){var c="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(c+=" 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 x=kr();x?c+=x:c+=Ke();var m;e===null?m="null":we(e)?m="array":e!==void 0&&e.$$typeof===a?(m="<"+(N(e.type)||"Unknown")+" />",c=" Did you accidentally export a JSX literal instead of a component?"):m=typeof e,h("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",m,c)}var E=Dr(e,r,n,d,v);if(E==null)return E;if(u){var D=r.children;if(D!==void 0)if(l)if(we(D)){for(var q=0;q<D.length;q++)Xe(D[q],e);Object.freeze&&Object.freeze(D)}else h("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 Xe(D,e)}if(ee.call(r,"key")){var z=N(e),S=Object.keys(r).filter(function(Yr){return Yr!=="key"}),Se=S.length>0?"{key: someKey, "+S.join(": ..., ")+": ...}":"{key: someKey}";if(!Ze[z+Se]){var Wr=S.length>0?"{"+S.join(": ..., ")+": ...}":"{}";h(`A props object containing a "key" prop is being spread into JSX:
|
|
26
26
|
let props = %s;
|
|
27
27
|
<%s {...props} />
|
|
28
28
|
React keys must be passed directly to JSX without using spread:
|
|
29
29
|
let props = %s;
|
|
30
|
-
<%s key={someKey} {...props} />`,
|
|
30
|
+
<%s key={someKey} {...props} />`,Se,z,Wr,z),Ze[z+Se]=!0}}return e===o?Ir(E):Br(E),E}}function Fr(e,r,n){return Qe(e,r,n,!0)}function Ar(e,r,n){return Qe(e,r,n,!1)}var Lr=Ar,$r=Fr;J.Fragment=o,J.jsx=Lr,J.jsxs=$r})()),J}var ke;function tr(){return ke||(ke=1,process.env.NODE_ENV==="production"?re.exports=er():re.exports=rr()),re.exports}var _=tr();const he={primaryButton:"_primaryButton_uyzzr_1",primaryButtonDisabled:"_primaryButtonDisabled_uyzzr_34",spinner:"_spinner_uyzzr_42"};var Ne={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Be=b.createContext&&b.createContext(Ne),nr=["attr","size","title"];function ar(t,a){if(t==null)return{};var i=ir(t,a),o,p;if(Object.getOwnPropertySymbols){var O=Object.getOwnPropertySymbols(t);for(p=0;p<O.length;p++)o=O[p],!(a.indexOf(o)>=0)&&Object.prototype.propertyIsEnumerable.call(t,o)&&(i[o]=t[o])}return i}function ir(t,a){if(t==null)return{};var i={};for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){if(a.indexOf(o)>=0)continue;i[o]=t[o]}return i}function te(){return te=Object.assign?Object.assign.bind():function(t){for(var a=1;a<arguments.length;a++){var i=arguments[a];for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&(t[o]=i[o])}return t},te.apply(this,arguments)}function Ie(t,a){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);a&&(o=o.filter(function(p){return Object.getOwnPropertyDescriptor(t,p).enumerable})),i.push.apply(i,o)}return i}function ne(t){for(var a=1;a<arguments.length;a++){var i=arguments[a]!=null?arguments[a]:{};a%2?Ie(Object(i),!0).forEach(function(o){or(t,o,i[o])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(i)):Ie(Object(i)).forEach(function(o){Object.defineProperty(t,o,Object.getOwnPropertyDescriptor(i,o))})}return t}function or(t,a,i){return a=sr(a),a in t?Object.defineProperty(t,a,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[a]=i,t}function sr(t){var a=lr(t,"string");return typeof a=="symbol"?a:a+""}function lr(t,a){if(typeof t!="object"||!t)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var o=i.call(t,a);if(typeof o!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(t)}function Fe(t){return t&&t.map((a,i)=>b.createElement(a.tag,ne({key:i},a.attr),Fe(a.child)))}function ge(t){return a=>b.createElement(cr,te({attr:ne({},t.attr)},a),Fe(t.child))}function cr(t){var a=i=>{var{attr:o,size:p,title:O}=t,C=ar(t,nr),y=p||i.size||"1em",f;return i.className&&(f=i.className),t.className&&(f=(f?f+" ":"")+t.className),b.createElement("svg",te({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},i.attr,o,C,{className:f,style:ne(ne({color:t.color||i.color},i.style),t.style),height:y,width:y,xmlns:"http://www.w3.org/2000/svg"}),O&&b.createElement("title",null,O),t.children)};return Be!==void 0?b.createElement(Be.Consumer,null,i=>a(i)):a(Ne)}function ur(t){return ge({attr:{viewBox:"0 0 24 24",fill:"none"},child:[{tag:"path",attr:{opacity:"0.2",fillRule:"evenodd",clipRule:"evenodd",d:"M12 19C15.866 19 19 15.866 19 12C19 8.13401 15.866 5 12 5C8.13401 5 5 8.13401 5 12C5 15.866 8.13401 19 12 19ZM12 22C17.5228 22 22 17.5228 22 12C22 6.47715 17.5228 2 12 2C6.47715 2 2 6.47715 2 12C2 17.5228 6.47715 22 12 22Z",fill:"currentColor"},child:[]},{tag:"path",attr:{d:"M2 12C2 6.47715 6.47715 2 12 2V5C8.13401 5 5 8.13401 5 12H2Z",fill:"currentColor"},child:[]}]})(t)}const fr=({children:t,disabled:a=!1,loading:i=!1,onClick:o,className:p="","data-testid":O,...C})=>{const y=[he.primaryButton,a?he.primaryButtonDisabled:"",p].filter(Boolean).join(" ");return _.jsxs("button",{type:"button",className:y,disabled:a||i,onClick:o,"data-testid":O,...C,children:[i&&_.jsx(ur,{className:he.spinner,size:12}),t]})},Ae={secondaryButton:"_secondaryButton_1s7ft_1",secondaryButtonDisabled:"_secondaryButtonDisabled_1s7ft_33"},dr=({children:t,disabled:a=!1,onClick:i,className:o="","data-testid":p,...O})=>{const C=[Ae.secondaryButton,a?Ae.secondaryButtonDisabled:"",o].filter(Boolean).join(" ");return _.jsx("button",{type:"button",className:C,disabled:a,onClick:i,"data-testid":p,...O,children:t})},I={tabsContainer:"_tabsContainer_m3c4e_1",tabsHeader:"_tabsHeader_m3c4e_7",tabItem:"_tabItem_m3c4e_13",tabContent:"_tabContent_m3c4e_29",tabLabel:"_tabLabel_m3c4e_51",tabLine:"_tabLine_m3c4e_61",active:"_active_m3c4e_68",inactive:"_inactive_m3c4e_76",tabPanels:"_tabPanels_m3c4e_84"},vr=({tabs:t,activeTabId:a,onTabChange:i,className:o="","data-testid":p,...O})=>{var y;const C=[I.tabsContainer,o].filter(Boolean).join(" ");return _.jsxs("div",{className:C,"data-testid":p,...O,children:[_.jsx("div",{className:I.tabsHeader,children:t.map(f=>{const T=f.id===a,w=[I.tabItem,T?I.active:I.inactive].filter(Boolean).join(" ");return _.jsxs("button",{type:"button",className:w,onClick:()=>i(f.id),"data-testid":`${p}-tab-${f.id}`,children:[_.jsx("div",{className:I.tabContent,children:_.jsx("span",{className:I.tabLabel,children:f.label})}),_.jsx("div",{className:I.tabLine})]},f.id)})}),_.jsx("div",{className:I.tabPanels,children:(y=t.find(f=>f.id===a))==null?void 0:y.content})]})};function pr(t){return ge({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}function br(t){return ge({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"11",cy:"11",r:"8"},child:[]},{tag:"line",attr:{x1:"21",y1:"21",x2:"16.65",y2:"16.65"},child:[]}]})(t)}const j={root:"_root_28cvi_1",label:"_label_28cvi_8",required:"_required_28cvi_16",trigger:"_trigger_28cvi_21",triggerDisabled:"_triggerDisabled_28cvi_43",value:"_value_28cvi_49",placeholder:"_placeholder_28cvi_57",chevron:"_chevron_28cvi_61",open:"_open_28cvi_68",panel:"_panel_28cvi_72",filterWrapper:"_filterWrapper_28cvi_85",filterInput:"_filterInput_28cvi_91",filterIcon:"_filterIcon_28cvi_109",list:"_list_28cvi_120",option:"_option_28cvi_128",optionHighlighted:"_optionHighlighted_28cvi_139",empty:"_empty_28cvi_143",disabled:"_disabled_28cvi_150"},Ee=(t,a)=>{const o=t[a];return o!=null?String(o):""},ae=(t,a)=>t[a],_r=({value:t,onChange:a,options:i,optionLabel:o="label",optionValue:p="value",placeholder:O="Select",filter:C=!1,disabled:y=!1,required:f=!1,label:T,inputId:w,className:k="",panelClassName:F="","data-testid":R})=>{const[P,Y]=b.useState(!1),[ie,A]=b.useState(""),[h,M]=b.useState(0),G=b.useRef(null),je=b.useRef(null),oe=b.useRef(null),se=b.useRef(null),le=i.find(s=>ae(s,p)===t),ce=le?Ee(le,o):"",L=C?i.filter(s=>Ee(s,o).toLowerCase().includes(ie.toLowerCase())):i;b.useEffect(()=>{P&&C&&(A(""),M(0),setTimeout(()=>{var s;return(s=oe.current)==null?void 0:s.focus()},0))},[P,C]),b.useEffect(()=>{if(!P)return;const s=L.findIndex(g=>ae(g,p)===t);M(s>=0?s:0)},[P,t,L,p]),b.useEffect(()=>{const s=se.current;s!=null&&s.scrollIntoView&&typeof s.scrollIntoView=="function"&&s.scrollIntoView({block:"nearest"})},[h]),b.useEffect(()=>{if(!P)return;const s=g=>{G.current&&!G.current.contains(g.target)&&Y(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[P]);const ue=()=>{y||Y(s=>!s)},N=(s,g)=>{const W=ae(s,p);a==null||a({value:W??null,originalEvent:g}),Y(!1)},$=s=>{if(!P){(s.key==="Enter"||s.key===" "||s.key==="ArrowDown")&&(s.preventDefault(),Y(!0));return}if(s.key==="Escape"){s.preventDefault(),Y(!1);return}if(s.key==="ArrowDown"){s.preventDefault(),M(g=>g<L.length-1?g+1:g);return}if(s.key==="ArrowUp"){s.preventDefault(),M(g=>g>0?g-1:0);return}s.key==="Enter"&&L[h]&&(s.preventDefault(),N(L[h],s))},V=[j.root,y?j.disabled:"",P?j.open:"",k].filter(Boolean).join(" "),fe=[j.trigger,y?j.triggerDisabled:""].filter(Boolean).join(" "),de=[j.panel,F].filter(Boolean).join(" "),U=w??`dropdown-${Math.random().toString(36).slice(2,9)}`,X=`${U}-panel`;return _.jsxs("div",{className:V,ref:G,"data-testid":R,children:[T!=null&&_.jsxs("label",{htmlFor:U,className:j.label,children:[T,f&&_.jsx("span",{className:j.required,children:"*"})]}),_.jsxs("div",{id:U,role:"combobox","aria-expanded":P,"aria-haspopup":"listbox","aria-controls":P?X:void 0,"aria-disabled":y,"aria-label":typeof T=="string"?T:void 0,tabIndex:y?-1:0,className:fe,onClick:ue,onKeyDown:$,"data-testid":R?`${R}-trigger`:void 0,children:[_.jsx("span",{className:j.value,children:ce||_.jsx("span",{className:j.placeholder,children:O})}),_.jsx(pr,{className:j.chevron,"aria-hidden":!0})]}),P&&_.jsxs("div",{ref:je,id:X,className:de,role:"presentation","data-testid":R?`${R}-panel`:void 0,children:[C&&_.jsxs("div",{className:j.filterWrapper,children:[_.jsx("input",{ref:oe,type:"text",className:j.filterInput,value:ie,onChange:s=>{A(s.target.value),M(0)},onKeyDown:s=>{s.key==="Escape"&&Y(!1),s.stopPropagation()},placeholder:"Search...","aria-label":"Filter options",title:"Filter options","data-testid":R?`${R}-filter`:void 0}),_.jsx(br,{className:j.filterIcon,"aria-hidden":!0})]}),_.jsx("ul",{className:j.list,role:"listbox","aria-label":"Options",children:L.length===0?_.jsx("li",{className:j.empty,children:"No results"}):L.map((s,g)=>{const W=ae(s,p),ve=Ee(s,o),Oe=t===W,pe=g===h,Z=W!=null?String(W):`option-${g}`;return _.jsx("li",{ref:pe?se:void 0,role:"option","aria-selected":Oe,className:[j.option,pe?j.optionHighlighted:""].filter(Boolean).join(" "),onMouseEnter:()=>M(g),onClick:Q=>N(s,Q),"data-testid":R?`${R}-option-${g}`:void 0,children:ve},Z)})})]})]})};B.Dropdown=_r,B.PrimaryButton=fr,B.SecondaryButton=dr,B.Tabs=vr,Object.defineProperty(B,Symbol.toStringTag,{value:"Module"})}));
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._primaryButton_uyzzr_1{background:var(--color-primary);border:1px solid var(--color-primary);align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:#fff;padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease}._primaryButton_uyzzr_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._primaryButton_uyzzr_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid var(--color-primary-hover);background:var(--color-primary-hover);opacity:.8}._primaryButton_uyzzr_1:hover{border:1px solid var(--color-primary-hover);background:var(--color-primary-hover)}._primaryButtonDisabled_uyzzr_34{cursor:not-allowed;opacity:.8}._primaryButtonDisabled_uyzzr_34:hover{transform:none}._spinner_uyzzr_42{animation:_spin_uyzzr_42 1s linear infinite;margin-right:.5rem}@keyframes _spin_uyzzr_42{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._secondaryButton_1s7ft_1{background:transparent;border:1px solid var(--color-primary);align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:var(--color-primary);padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease,border-color .3s ease,color .3s ease}._secondaryButton_1s7ft_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._secondaryButton_1s7ft_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid #9cbbe3;background:transparent;opacity:.5}._secondaryButton_1s7ft_1:hover{background:#efefef}._secondaryButtonDisabled_1s7ft_33{cursor:not-allowed;opacity:.65}._secondaryButtonDisabled_1s7ft_33:hover{transform:none;background:transparent;color:#9cbbe3}._tabsContainer_m3c4e_1{display:flex;flex-direction:column;width:100%}._tabsHeader_m3c4e_7{display:flex;align-items:center;gap:0}._tabItem_m3c4e_13{display:flex;flex-direction:column;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .2s ease;background:none;border:none;padding:0;margin:0;font-family:inherit;font-size:inherit;color:inherit}._tabItem_m3c4e_13:hover ._tabContent_m3c4e_29{background-color:#128afb0d}._tabItem_m3c4e_13:focus{outline:none}._tabItem_m3c4e_13:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}._tabContent_m3c4e_29{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;padding:var(--spacing-sm) var(--spacing-md);border-radius:var(--border-radius-sm) var(--border-radius-sm) 0 0;transition:background-color .2s ease}._tabLabel_m3c4e_51{font-family:Lato,sans-serif;font-size:var(--font-size-base);line-height:1.5em;text-align:center;font-weight:var(--font-weight-normal);color:var(--color-text-secondary);transition:color .2s ease}._tabLine_m3c4e_61{width:100%;height:2px;background-color:transparent;transition:background-color .2s ease}._active_m3c4e_68 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-bold);color:var(--color-text-primary)}._active_m3c4e_68 ._tabLine_m3c4e_61{background-color:var(--color-primary)}._inactive_m3c4e_76 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-normal);color:var(--color-text-secondary)}._inactive_m3c4e_76 ._tabLine_m3c4e_61{background-color:var(--color-border-light)}._tabPanels_m3c4e_84{padding:var(--spacing-md) 0;background-color:transparent}
|
|
1
|
+
._primaryButton_uyzzr_1{background:var(--color-primary);border:1px solid var(--color-primary);align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:#fff;padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease}._primaryButton_uyzzr_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._primaryButton_uyzzr_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid var(--color-primary-hover);background:var(--color-primary-hover);opacity:.8}._primaryButton_uyzzr_1:hover{border:1px solid var(--color-primary-hover);background:var(--color-primary-hover)}._primaryButtonDisabled_uyzzr_34{cursor:not-allowed;opacity:.8}._primaryButtonDisabled_uyzzr_34:hover{transform:none}._spinner_uyzzr_42{animation:_spin_uyzzr_42 1s linear infinite;margin-right:.5rem}@keyframes _spin_uyzzr_42{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._secondaryButton_1s7ft_1{background:transparent;border:1px solid var(--color-primary);align-items:center;border-radius:4px;font-family:Lato,sans-serif;font-style:normal;font-weight:700;font-size:12px;line-height:1.5;text-transform:uppercase;color:var(--color-primary);padding:0 1.5rem;cursor:pointer;height:34px;transition:background-color .3s ease,border-color .3s ease,color .3s ease}._secondaryButton_1s7ft_1:focus{outline:0;box-shadow:0 0 0 .2rem #007bff40}._secondaryButton_1s7ft_1:disabled{cursor:not-allowed;color:#9cbbe3;border:1px solid #9cbbe3;background:transparent;opacity:.5}._secondaryButton_1s7ft_1:hover{background:#efefef}._secondaryButtonDisabled_1s7ft_33{cursor:not-allowed;opacity:.65}._secondaryButtonDisabled_1s7ft_33:hover{transform:none;background:transparent;color:#9cbbe3}._tabsContainer_m3c4e_1{display:flex;flex-direction:column;width:100%}._tabsHeader_m3c4e_7{display:flex;align-items:center;gap:0}._tabItem_m3c4e_13{display:flex;flex-direction:column;align-items:center;cursor:pointer;-webkit-user-select:none;user-select:none;transition:all .2s ease;background:none;border:none;padding:0;margin:0;font-family:inherit;font-size:inherit;color:inherit}._tabItem_m3c4e_13:hover ._tabContent_m3c4e_29{background-color:#128afb0d}._tabItem_m3c4e_13:focus{outline:none}._tabItem_m3c4e_13:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}._tabContent_m3c4e_29{display:flex;flex-direction:row;justify-content:center;align-items:center;gap:10px;padding:var(--spacing-sm) var(--spacing-md);border-radius:var(--border-radius-sm) var(--border-radius-sm) 0 0;transition:background-color .2s ease}._tabLabel_m3c4e_51{font-family:Lato,sans-serif;font-size:var(--font-size-base);line-height:1.5em;text-align:center;font-weight:var(--font-weight-normal);color:var(--color-text-secondary);transition:color .2s ease}._tabLine_m3c4e_61{width:100%;height:2px;background-color:transparent;transition:background-color .2s ease}._active_m3c4e_68 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-bold);color:var(--color-text-primary)}._active_m3c4e_68 ._tabLine_m3c4e_61{background-color:var(--color-primary)}._inactive_m3c4e_76 ._tabLabel_m3c4e_51{font-weight:var(--font-weight-normal);color:var(--color-text-secondary)}._inactive_m3c4e_76 ._tabLine_m3c4e_61{background-color:var(--color-border-light)}._tabPanels_m3c4e_84{padding:var(--spacing-md) 0;background-color:transparent}._root_28cvi_1{position:relative;display:inline-block;min-width:200px;width:100%}._label_28cvi_8{display:block;font-weight:var(--font-weight-bold);color:var(--color-text-primary);margin-bottom:var(--spacing-sm);font-size:var(--font-size-base)}._required_28cvi_16{color:var(--color-text-secondary);margin-left:2px}._trigger_28cvi_21{display:flex;align-items:center;justify-content:space-between;width:100%;min-height:40px;padding:.5rem .75rem;background:var(--color-bg-primary);border:1px solid var(--color-input-border);border-radius:var(--border-radius-md);cursor:pointer;transition:border-color .2s ease,box-shadow .2s ease;font-size:var(--font-size-base);color:var(--color-text-primary);gap:.5rem}._trigger_28cvi_21:focus{outline:0;border-color:var(--color-input-focus);box-shadow:0 0 0 2px #4285f433}._triggerDisabled_28cvi_43{cursor:not-allowed;opacity:.7;background:var(--color-bg-secondary)}._value_28cvi_49{flex:1;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._placeholder_28cvi_57{color:var(--color-text-secondary)}._chevron_28cvi_61{flex-shrink:0;color:var(--color-text-secondary);width:1.25rem;height:1.25rem}._open_28cvi_68 ._chevron_28cvi_61{transform:rotate(180deg)}._panel_28cvi_72{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:1000;background:var(--color-bg-primary);border:1px solid var(--color-border-light);border-radius:var(--border-radius-md);box-shadow:0 4px 12px #00000026;overflow:hidden}._filterWrapper_28cvi_85{position:relative;padding:.5rem .75rem;border-bottom:1px solid var(--color-border-light)}._filterInput_28cvi_91{width:100%;padding:.5rem 2rem .5rem .75rem;border:1px solid var(--color-dropdown-filter-border);border-radius:var(--border-radius-sm);font-size:var(--font-size-sm);color:var(--color-text-primary);background:var(--color-bg-primary)}._filterInput_28cvi_91:focus{outline:0;border-color:var(--color-dropdown-filter-border);box-shadow:0 0 0 2px #8b7eff33}._filterInput_28cvi_91::placeholder{color:var(--color-text-secondary)}._filterIcon_28cvi_109{position:absolute;right:1rem;top:50%;transform:translateY(-50%);color:var(--color-text-secondary);width:1rem;height:1rem;pointer-events:none}._list_28cvi_120{list-style:none;margin:0;padding:.25rem 0;max-height:240px;overflow-y:auto}._option_28cvi_128{padding:.5rem .75rem;cursor:pointer;font-size:var(--font-size-base);color:var(--color-text-primary);transition:background-color .15s ease}._option_28cvi_128:hover,._option_28cvi_128:focus-visible{background:var(--color-dropdown-option-highlight)}._optionHighlighted_28cvi_139{background:var(--color-dropdown-option-highlight)}._empty_28cvi_143{padding:.75rem 1rem;color:var(--color-text-secondary);font-size:var(--font-size-sm);cursor:default}._disabled_28cvi_150 ._trigger_28cvi_21:hover{border-color:var(--color-input-border)}:root{--color-primary: #3b73bb;--color-primary-hover: #2665b7;--color-dark: #3e4759;--color-text-primary: #212529;--color-text-secondary: #6c757d;--color-bg-primary: #ffffff;--color-bg-secondary: #f8f9fa;--color-border-light: #e9ecef;--spacing-sm: .5rem;--spacing-md: 1rem;--spacing-lg: 1.5rem;--spacing-xl: 3rem;--border-radius-sm: .25rem;--border-radius-md: .375rem;--border-radius-lg: .5rem;--font-size-sm: .875rem;--font-size-base: 1rem;--font-size-lg: 1.125rem;--font-weight-normal: 400;--font-weight-bold: 700;--color-input-border: #e9ecef;--color-input-focus: #4285f4;--color-dropdown-option-highlight: #e6f0ff;--color-dropdown-filter-border: #8b7eff}body{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:var(--color-text-primary);background-color:var(--color-bg-primary);margin:0;padding:0}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emporix/component-library",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "A React component library for Emporix projects",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.umd.js",
|
|
@@ -72,8 +72,8 @@
|
|
|
72
72
|
"@typescript-eslint/eslint-plugin": "^7.2.0",
|
|
73
73
|
"@typescript-eslint/parser": "^7.2.0",
|
|
74
74
|
"@vitejs/plugin-react": "^4.3.1",
|
|
75
|
-
"@vitest/coverage-v8": "^
|
|
76
|
-
"@vitest/ui": "^
|
|
75
|
+
"@vitest/coverage-v8": "^4.0.18",
|
|
76
|
+
"@vitest/ui": "^4.0.18",
|
|
77
77
|
"eslint": "^8.57.0",
|
|
78
78
|
"eslint-config-prettier": "^9.1.0",
|
|
79
79
|
"eslint-plugin-prettier": "^5.1.3",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
"typescript": "^5.2.2",
|
|
91
91
|
"vite": "^6.4.1",
|
|
92
92
|
"vite-plugin-dts": "^4.5.4",
|
|
93
|
-
"vitest": "^
|
|
93
|
+
"vitest": "^4.0.18"
|
|
94
94
|
},
|
|
95
95
|
"dependencies": {
|
|
96
96
|
"@testing-library/jest-dom": "^6.4.2",
|